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

Percentage Accurate: 89.2% → 99.8%
Time: 15.5s
Alternatives: 16
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 16 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

      \[\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-define99.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. Add Preprocessing
  5. Final simplification99.9%

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

Alternative 3: 99.6% accurate, 1.7× speedup?

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

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

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

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

    \[\leadsto \left(\left(-1 + x\right) \cdot \log y + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right)\right) - t \]
  5. Add Preprocessing

Alternative 4: 73.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 0.46:\\
\;\;\;\;\left(-t\right) - \log y\\

\mathbf{elif}\;x \leq 1.65 \cdot 10^{+117}:\\
\;\;\;\;y \cdot \left(y \cdot \left(z \cdot -0.5 + -0.3333333333333333 \cdot \left(z \cdot y\right)\right) - z\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.02e110 or 1.6499999999999999e117 < x

    1. Initial program 98.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. +-commutative98.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-define98.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-neg98.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-eval98.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-neg98.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-define99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y \cdot x} \]
    10. Simplified83.4%

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

    if -1.02e110 < x < -5.4999999999999998e-157

    1. Initial program 71.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. +-commutative71.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-define71.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-neg71.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-eval71.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-neg71.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-define99.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. Add Preprocessing
    5. Taylor expanded in x around inf 70.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
    9. Step-by-step derivation
      1. associate-/l*40.2%

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

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

        \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
    10. Simplified64.0%

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
    11. Taylor expanded in y around 0 69.6%

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

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

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

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

    if -5.4999999999999998e-157 < x < 0.46000000000000002

    1. Initial program 86.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. +-commutative86.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-define86.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-neg86.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-eval86.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-neg86.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-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.46000000000000002 < x < 1.6499999999999999e117

    1. Initial program 84.5%

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

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

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

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

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

        \[\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-define99.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. Add Preprocessing
    5. Taylor expanded in x around inf 84.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
    9. Step-by-step derivation
      1. associate-/l*58.2%

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

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

        \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
    10. Simplified73.5%

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
    11. Taylor expanded in y around 0 73.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{+110}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-157}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \mathbf{elif}\;x \leq 0.46:\\ \;\;\;\;\left(-t\right) - \log y\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+117}:\\ \;\;\;\;y \cdot \left(y \cdot \left(z \cdot -0.5 + -0.3333333333333333 \cdot \left(z \cdot y\right)\right) - z\right) - t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.5% accurate, 1.7× speedup?

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

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

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

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

    \[\leadsto \left(\left(-1 + x\right) \cdot \log y + \left(z + -1\right) \cdot \left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right)\right) - t \]
  5. Add Preprocessing

Alternative 6: 84.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\left(-t\right) - \log y\\

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


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

    1. Initial program 92.3%

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

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

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

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

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

        \[\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-define99.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. Add Preprocessing
    5. Taylor expanded in x around inf 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999991e31 < x < -5.19999999999999977e-157

    1. Initial program 67.5%

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

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

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

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

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

        \[\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-define99.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. Add Preprocessing
    5. Taylor expanded in x around inf 66.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
    9. Step-by-step derivation
      1. associate-/l*41.7%

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

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

        \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
    10. Simplified67.2%

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
    11. Taylor expanded in y around 0 75.2%

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

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

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

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

    if -5.19999999999999977e-157 < x < 1

    1. Initial program 86.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. +-commutative86.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-define86.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-neg86.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-eval86.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-neg86.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-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+31}:\\ \;\;\;\;x \cdot \log y - t\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-157}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\left(-t\right) - \log y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 99.4% accurate, 1.8× speedup?

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

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

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

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

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

Alternative 8: 99.4% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 89.1% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 40.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. +-commutative40.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-define40.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-neg40.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-eval40.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-neg40.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-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
    9. Step-by-step derivation
      1. associate-/l*25.9%

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

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

        \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
    10. Simplified69.0%

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
    11. Taylor expanded in y around 0 88.5%

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

    if -5.5000000000000002e137 < z < 2.65000000000000006e175

    1. Initial program 97.2%

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

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

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

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

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

        \[\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-define99.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. Add Preprocessing
    5. Taylor expanded in y around 0 96.4%

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

    if 2.65000000000000006e175 < z

    1. Initial program 47.3%

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

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

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

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

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

        \[\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-define99.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. Add Preprocessing
    5. Taylor expanded in x around inf 45.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
    9. Step-by-step derivation
      1. associate-/l*31.5%

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

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

        \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
    10. Simplified68.0%

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
    11. Taylor expanded in y around 0 86.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+137}:\\ \;\;\;\;y \cdot \left(y \cdot \left(z \cdot -0.5 + -0.3333333333333333 \cdot \left(z \cdot y\right)\right) - z\right) - t\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{+175}:\\ \;\;\;\;\left(-1 + x\right) \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 65.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+110} \lor \neg \left(x \leq 2 \cdot 10^{+117}\right):\\
\;\;\;\;x \cdot \log y\\

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


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

    1. Initial program 98.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. +-commutative98.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-define98.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-neg98.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-eval98.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-neg98.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-define99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y \cdot x} \]
    10. Simplified83.4%

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

    if -1.09999999999999996e110 < x < 2.0000000000000001e117

    1. Initial program 80.5%

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

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

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

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

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

        \[\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-define99.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. Add Preprocessing
    5. Taylor expanded in x around inf 79.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
    9. Step-by-step derivation
      1. associate-/l*46.8%

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

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

        \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
    10. Simplified59.3%

      \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
    11. Taylor expanded in y around 0 66.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{+110} \lor \neg \left(x \leq 2 \cdot 10^{+117}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(z \cdot -0.5 + -0.3333333333333333 \cdot \left(z \cdot y\right)\right) - z\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 99.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

Alternative 12: 46.3% accurate, 12.6× speedup?

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

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

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

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

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

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

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

      \[\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-define99.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. Add Preprocessing
  5. Taylor expanded in x around inf 84.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
  9. Step-by-step derivation
    1. associate-/l*38.3%

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

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

      \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
  10. Simplified47.6%

    \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
  11. Taylor expanded in y around 0 52.8%

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

    \[\leadsto y \cdot \left(y \cdot \left(z \cdot -0.5 + -0.3333333333333333 \cdot \left(z \cdot y\right)\right) - z\right) - t \]
  13. Add Preprocessing

Alternative 13: 46.2% accurate, 19.5× speedup?

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

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

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

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

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

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

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

      \[\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-define99.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. Add Preprocessing
  5. Taylor expanded in x around inf 84.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
  9. Step-by-step derivation
    1. associate-/l*38.3%

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

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

      \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
  10. Simplified47.6%

    \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
  11. Taylor expanded in y around 0 52.7%

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

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

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

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

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

Alternative 14: 45.8% accurate, 35.8× speedup?

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

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

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

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

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

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

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

      \[\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-define99.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. Add Preprocessing
  5. Taylor expanded in x around inf 84.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot \color{blue}{\frac{z \cdot \log \left(1 - y\right)}{x}} - t \]
  9. Step-by-step derivation
    1. associate-/l*38.3%

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

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

      \[\leadsto x \cdot \left(z \cdot \frac{\color{blue}{\mathsf{log1p}\left(-y\right)}}{x}\right) - t \]
  10. Simplified47.6%

    \[\leadsto x \cdot \color{blue}{\left(z \cdot \frac{\mathsf{log1p}\left(-y\right)}{x}\right)} - t \]
  11. Taylor expanded in y around 0 52.2%

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

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

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

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

    \[\leadsto \left(-t\right) - z \cdot y \]
  15. Add Preprocessing

Alternative 15: 37.6% accurate, 71.7× speedup?

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

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

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

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

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

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

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

      \[\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-define99.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. Add Preprocessing
  5. Taylor expanded in t around inf 37.6%

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

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

    \[\leadsto \color{blue}{-t} \]
  8. Step-by-step derivation
    1. expm1-log1p-u17.5%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-t\right)\right)} \]
    2. expm1-undefine17.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
  9. Applied egg-rr17.3%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
  10. Step-by-step derivation
    1. sub-neg17.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} + \left(-1\right)} \]
    2. log1p-undefine17.3%

      \[\leadsto e^{\color{blue}{\log \left(1 + \left(-t\right)\right)}} + \left(-1\right) \]
    3. rem-exp-log37.4%

      \[\leadsto \color{blue}{\left(1 + \left(-t\right)\right)} + \left(-1\right) \]
    4. unsub-neg37.4%

      \[\leadsto \color{blue}{\left(1 - t\right)} + \left(-1\right) \]
    5. metadata-eval37.4%

      \[\leadsto \left(1 - t\right) + \color{blue}{-1} \]
  11. Simplified37.4%

    \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  12. Step-by-step derivation
    1. associate-+l-37.4%

      \[\leadsto \color{blue}{1 - \left(t - -1\right)} \]
    2. sub-neg37.4%

      \[\leadsto 1 - \color{blue}{\left(t + \left(--1\right)\right)} \]
    3. metadata-eval37.4%

      \[\leadsto 1 - \left(t + \color{blue}{1}\right) \]
  13. Applied egg-rr37.4%

    \[\leadsto \color{blue}{1 - \left(t + 1\right)} \]
  14. Taylor expanded in t around inf 39.7%

    \[\leadsto 1 - \color{blue}{t} \]
  15. Add Preprocessing

Alternative 16: 35.4% accurate, 107.5× speedup?

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

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

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

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

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

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

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

      \[\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-define99.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. Add Preprocessing
  5. Taylor expanded in t around inf 37.6%

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

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

    \[\leadsto \color{blue}{-t} \]
  8. Add Preprocessing

Reproduce

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