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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 89.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 94.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot \left(-1 + x\right)\\ \mathbf{if}\;t \leq -3.2 \cdot 10^{-7}:\\ \;\;\;\;t_1 - t\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-107}:\\ \;\;\;\;t_1 + \left(y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + t_1\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (log y) (+ -1.0 x))))
   (if (<= t -3.2e-7)
     (- t_1 t)
     (if (<= t 2.35e-107) (+ t_1 (- y (* z y))) (- (+ y t_1) t)))))
double code(double x, double y, double z, double t) {
	double t_1 = log(y) * (-1.0 + x);
	double tmp;
	if (t <= -3.2e-7) {
		tmp = t_1 - t;
	} else if (t <= 2.35e-107) {
		tmp = t_1 + (y - (z * y));
	} else {
		tmp = (y + t_1) - 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) * ((-1.0d0) + x)
    if (t <= (-3.2d-7)) then
        tmp = t_1 - t
    else if (t <= 2.35d-107) then
        tmp = t_1 + (y - (z * y))
    else
        tmp = (y + t_1) - 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) * (-1.0 + x);
	double tmp;
	if (t <= -3.2e-7) {
		tmp = t_1 - t;
	} else if (t <= 2.35e-107) {
		tmp = t_1 + (y - (z * y));
	} else {
		tmp = (y + t_1) - t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.log(y) * (-1.0 + x)
	tmp = 0
	if t <= -3.2e-7:
		tmp = t_1 - t
	elif t <= 2.35e-107:
		tmp = t_1 + (y - (z * y))
	else:
		tmp = (y + t_1) - t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(log(y) * Float64(-1.0 + x))
	tmp = 0.0
	if (t <= -3.2e-7)
		tmp = Float64(t_1 - t);
	elseif (t <= 2.35e-107)
		tmp = Float64(t_1 + Float64(y - Float64(z * y)));
	else
		tmp = Float64(Float64(y + t_1) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = log(y) * (-1.0 + x);
	tmp = 0.0;
	if (t <= -3.2e-7)
		tmp = t_1 - t;
	elseif (t <= 2.35e-107)
		tmp = t_1 + (y - (z * y));
	else
		tmp = (y + t_1) - t;
	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[LessEqual[t, -3.2e-7], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[t, 2.35e-107], N[(t$95$1 + N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + t$95$1), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 2.35 \cdot 10^{-107}:\\
\;\;\;\;t_1 + \left(y - z \cdot y\right)\\

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


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

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e-7 < t < 2.34999999999999999e-107

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.34999999999999999e-107 < t

    1. Initial program 98.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 z around 0 97.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - \color{blue}{\mathsf{log1p}\left(-1 \cdot y\right)}\right) - t \]
      12. mul-1-neg97.6%

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

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

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

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

Alternative 5: 86.5% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999977e36 < (-.f64 x 1) < 20

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - \color{blue}{\mathsf{log1p}\left(-1 \cdot y\right)}\right) - t \]
      12. mul-1-neg88.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 90.1% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 58.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 + \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right)}\right) - t \]
    3. Step-by-step derivation
      1. fma-def99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000001e208 < z < 3.99999999999999984e217

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999984e217 < z

    1. Initial program 46.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 + \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right)}\right) - t \]
    3. Step-by-step derivation
      1. fma-def100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 89.9% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 58.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 + \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right)}\right) - t \]
    3. Step-by-step derivation
      1. fma-def99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.69999999999999989e208 < z < 4.1e214

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

    if 4.1e214 < z

    1. Initial program 46.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 + \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right)}\right) - t \]
    3. Step-by-step derivation
      1. fma-def100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 78.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+15} \lor \neg \left(t \leq 1000000000\right):\\
\;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5e15 or 1e9 < t

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e15 < t < 1e9

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 61.4% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e204 or 1.08000000000000006e89 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e204 < z < 1.08000000000000006e89

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 54.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_1 := -0.5 \cdot \left(y \cdot y\right) - y\\
\mathbf{if}\;t \leq -6 \cdot 10^{-137}:\\
\;\;\;\;\left(z + -1\right) \cdot t_1 - t\\

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

\mathbf{else}:\\
\;\;\;\;z \cdot t_1 - t\\


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

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.9999999999999996e-137 < t < 1.95e6

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
    6. Step-by-step derivation
      1. mul-1-neg44.3%

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

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

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

        \[\leadsto \color{blue}{-\log y} \]
    10. Simplified44.4%

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

    if 1.95e6 < t

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.2% accurate, 16.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 47.0% accurate, 19.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 46.7% accurate, 35.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 36.1% accurate, 107.5× speedup?

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

\\
-t
\end{array}
Derivation
  1. Initial program 91.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. +-commutative91.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -t \]

Reproduce

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