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

Percentage Accurate: 89.4% → 99.8%
Time: 14.5s
Alternatives: 18
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 89.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 94.3% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 95.0%

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

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

    if -2.00000000000000012e63 < (-.f64 x 1) < -0.5

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.2% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\ t_3 := -\log y\\ \mathbf{if}\;x \leq -2.95 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-246}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-228}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-99}:\\ \;\;\;\;\left(y - z \cdot y\right) - t\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-81}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+119}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (log y) x))
        (t_2 (- (- (* (* y y) (+ 0.5 (* z -0.5))) (* y (+ z -1.0))) t))
        (t_3 (- (log y))))
   (if (<= x -2.95e+63)
     t_1
     (if (<= x 2e-246)
       t_2
       (if (<= x 2.1e-228)
         t_3
         (if (<= x 2.15e-99)
           (- (- y (* z y)) t)
           (if (<= x 4.5e-81) t_3 (if (<= x 7.2e+119) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = log(y) * x;
	double t_2 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	double t_3 = -log(y);
	double tmp;
	if (x <= -2.95e+63) {
		tmp = t_1;
	} else if (x <= 2e-246) {
		tmp = t_2;
	} else if (x <= 2.1e-228) {
		tmp = t_3;
	} else if (x <= 2.15e-99) {
		tmp = (y - (z * y)) - t;
	} else if (x <= 4.5e-81) {
		tmp = t_3;
	} else if (x <= 7.2e+119) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = log(y) * x
    t_2 = (((y * y) * (0.5d0 + (z * (-0.5d0)))) - (y * (z + (-1.0d0)))) - t
    t_3 = -log(y)
    if (x <= (-2.95d+63)) then
        tmp = t_1
    else if (x <= 2d-246) then
        tmp = t_2
    else if (x <= 2.1d-228) then
        tmp = t_3
    else if (x <= 2.15d-99) then
        tmp = (y - (z * y)) - t
    else if (x <= 4.5d-81) then
        tmp = t_3
    else if (x <= 7.2d+119) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.log(y) * x;
	double t_2 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	double t_3 = -Math.log(y);
	double tmp;
	if (x <= -2.95e+63) {
		tmp = t_1;
	} else if (x <= 2e-246) {
		tmp = t_2;
	} else if (x <= 2.1e-228) {
		tmp = t_3;
	} else if (x <= 2.15e-99) {
		tmp = (y - (z * y)) - t;
	} else if (x <= 4.5e-81) {
		tmp = t_3;
	} else if (x <= 7.2e+119) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.log(y) * x
	t_2 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t
	t_3 = -math.log(y)
	tmp = 0
	if x <= -2.95e+63:
		tmp = t_1
	elif x <= 2e-246:
		tmp = t_2
	elif x <= 2.1e-228:
		tmp = t_3
	elif x <= 2.15e-99:
		tmp = (y - (z * y)) - t
	elif x <= 4.5e-81:
		tmp = t_3
	elif x <= 7.2e+119:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(log(y) * x)
	t_2 = Float64(Float64(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - Float64(y * Float64(z + -1.0))) - t)
	t_3 = Float64(-log(y))
	tmp = 0.0
	if (x <= -2.95e+63)
		tmp = t_1;
	elseif (x <= 2e-246)
		tmp = t_2;
	elseif (x <= 2.1e-228)
		tmp = t_3;
	elseif (x <= 2.15e-99)
		tmp = Float64(Float64(y - Float64(z * y)) - t);
	elseif (x <= 4.5e-81)
		tmp = t_3;
	elseif (x <= 7.2e+119)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = log(y) * x;
	t_2 = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	t_3 = -log(y);
	tmp = 0.0;
	if (x <= -2.95e+63)
		tmp = t_1;
	elseif (x <= 2e-246)
		tmp = t_2;
	elseif (x <= 2.1e-228)
		tmp = t_3;
	elseif (x <= 2.15e-99)
		tmp = (y - (z * y)) - t;
	elseif (x <= 4.5e-81)
		tmp = t_3;
	elseif (x <= 7.2e+119)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$3 = (-N[Log[y], $MachinePrecision])}, If[LessEqual[x, -2.95e+63], t$95$1, If[LessEqual[x, 2e-246], t$95$2, If[LessEqual[x, 2.1e-228], t$95$3, If[LessEqual[x, 2.15e-99], N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 4.5e-81], t$95$3, If[LessEqual[x, 7.2e+119], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\
t_3 := -\log y\\
\mathbf{if}\;x \leq -2.95 \cdot 10^{+63}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 2 \cdot 10^{-246}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 2.1 \cdot 10^{-228}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;x \leq 4.5 \cdot 10^{-81}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq 7.2 \cdot 10^{+119}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.95000000000000014e63 or 7.20000000000000003e119 < x

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.95000000000000014e63 < x < 1.99999999999999991e-246 or 4.5e-81 < x < 7.20000000000000003e119

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999991e-246 < x < 2.09999999999999991e-228 or 2.1499999999999999e-99 < x < 4.5e-81

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.09999999999999991e-228 < x < 2.1499999999999999e-99

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.95 \cdot 10^{+63}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-246}:\\ \;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-228}:\\ \;\;\;\;-\log y\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-99}:\\ \;\;\;\;\left(y - z \cdot y\right) - t\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-81}:\\ \;\;\;\;-\log y\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+119}:\\ \;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]

Alternative 6: 95.4% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.4999999999999997e-12 or 7.2e16 < t

    1. Initial program 93.6%

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

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

    if -8.4999999999999997e-12 < t < 7.2e16

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 74.6% accurate, 1.9× speedup?

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

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

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

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

\mathbf{elif}\;x \leq 1.95 \cdot 10^{+63} \lor \neg \left(x \leq 3.1 \cdot 10^{+115}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.75000000000000002e63 or 3.1999999999999999e32 < x < 1.95e63 or 3.10000000000000005e115 < x

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.75000000000000002e63 < x < -4.5000000000000003e-58

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000003e-58 < x < 3.1999999999999999e32

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(\log y + t\right)} \]
    9. Simplified86.0%

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

    if 1.95e63 < x < 3.10000000000000005e115

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.75 \cdot 10^{+63}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-58}:\\ \;\;\;\;\left(y - z \cdot y\right) - t\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+32}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{elif}\;x \leq 1.95 \cdot 10^{+63} \lor \neg \left(x \leq 3.1 \cdot 10^{+115}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-z\right) - t\\ \end{array} \]

Alternative 8: 74.6% accurate, 1.9× speedup?

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

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

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

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

\mathbf{elif}\;x \leq 6.2 \cdot 10^{+61} \lor \neg \left(x \leq 7.2 \cdot 10^{+119}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.9000000000000001e63 or 3.09999999999999993e32 < x < 6.1999999999999998e61 or 7.20000000000000003e119 < x

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000001e63 < x < -3.0999999999999999e-58

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0999999999999999e-58 < x < 3.09999999999999993e32

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.1999999999999998e61 < x < 7.20000000000000003e119

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{+63}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq -3.1 \cdot 10^{-58}:\\ \;\;\;\;\left(y - z \cdot y\right) - t\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+32}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+61} \lor \neg \left(x \leq 7.2 \cdot 10^{+119}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-z\right) - t\\ \end{array} \]

Alternative 9: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 98.9% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{\log y}{\frac{1}{x + -1}} - y \cdot z\right)} - t \]
    9. associate-/r/99.4%

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

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

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

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

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

Alternative 11: 78.0% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -13200000000:\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\

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

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


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

    1. Initial program 93.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. associate--l+93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.32e10 < t < 9.5000000000000003e62

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.5000000000000003e62 < t

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 88.2% accurate, 2.0× speedup?

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

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

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

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

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

Alternative 13: 56.2% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-\log y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.5000000000000002e-4 or 2.05000000000000016e-8 < t

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(0.5 + -0.5 \cdot z\right) \cdot \left(y \cdot y\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
      12. metadata-eval76.0%

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

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

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

    if -7.5000000000000002e-4 < t < 2.05000000000000016e-8

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\log y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.7%

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

Alternative 14: 47.1% accurate, 12.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 46.8% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 46.6% accurate, 35.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 36.7% accurate, 71.7× speedup?

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

\\
y - t
\end{array}
Derivation
  1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y} - t \]
  9. Final simplification39.0%

    \[\leadsto y - t \]

Alternative 18: 36.4% accurate, 107.5× speedup?

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

\\
-t
\end{array}
Derivation
  1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -t \]

Reproduce

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