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

Percentage Accurate: 89.9% → 99.8%
Time: 15.4s
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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.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-define89.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-neg89.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-eval89.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-neg89.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.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. Final simplification99.8%

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

Alternative 2: 99.6% accurate, 1.7× speedup?

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

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

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

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

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

Alternative 3: 97.4% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 x #s(literal 1 binary64)) < -5.0000000000000001e26 or -1 < (-.f64 x #s(literal 1 binary64))

    1. Initial program 93.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z + -1, \log \color{blue}{\left(1 + \left(-y\right)\right)}, \left(x - 1\right) \cdot \log y\right) - t \]
      6. log1p-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 y around 0 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000001e26 < (-.f64 x #s(literal 1 binary64)) < -1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.1% accurate, 1.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 x #s(literal 1 binary64)) < -1.00000500000000003

    1. Initial program 94.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. +-commutative94.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-define94.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-neg94.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-eval94.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-neg94.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 94.2%

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

    if -1.00000500000000003 < (-.f64 x #s(literal 1 binary64)) < 4.99999999999999973e33

    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-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 0 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999973e33 < (-.f64 x #s(literal 1 binary64))

    1. Initial program 97.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. +-commutative97.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-define97.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-neg97.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-eval97.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-neg97.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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.6% accurate, 1.7× speedup?

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

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

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

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

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

Alternative 6: 95.0% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 x #s(literal 1 binary64)) < -1.00000500000000003

    1. Initial program 94.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. +-commutative94.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-define94.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-neg94.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-eval94.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-neg94.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 94.2%

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

    if -1.00000500000000003 < (-.f64 x #s(literal 1 binary64)) < 4.99999999999999973e33

    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-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 y around 0 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999973e33 < (-.f64 x #s(literal 1 binary64))

    1. Initial program 97.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. +-commutative97.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-define97.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-neg97.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-eval97.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-neg97.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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.4% accurate, 1.8× speedup?

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

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

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

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

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

Alternative 8: 76.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -4.6 \cdot 10^{+104}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-14}:\\ \;\;\;\;\left(-t\right) - \log y\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{+84}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\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 -4.6e+104)
     t_1
     (if (<= x 1.2e-14)
       (- (- t) (log y))
       (if (<= x 1.85e+84) (- (* y (* z (+ -1.0 (* y -0.5)))) t) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -4.6e+104) {
		tmp = t_1;
	} else if (x <= 1.2e-14) {
		tmp = -t - log(y);
	} else if (x <= 1.85e+84) {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - 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 <= (-4.6d+104)) then
        tmp = t_1
    else if (x <= 1.2d-14) then
        tmp = -t - log(y)
    else if (x <= 1.85d+84) then
        tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - 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 <= -4.6e+104) {
		tmp = t_1;
	} else if (x <= 1.2e-14) {
		tmp = -t - Math.log(y);
	} else if (x <= 1.85e+84) {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	tmp = 0
	if x <= -4.6e+104:
		tmp = t_1
	elif x <= 1.2e-14:
		tmp = -t - math.log(y)
	elif x <= 1.85e+84:
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -4.6e+104)
		tmp = t_1;
	elseif (x <= 1.2e-14)
		tmp = Float64(Float64(-t) - log(y));
	elseif (x <= 1.85e+84)
		tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - 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 <= -4.6e+104)
		tmp = t_1;
	elseif (x <= 1.2e-14)
		tmp = -t - log(y);
	elseif (x <= 1.85e+84)
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - 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, -4.6e+104], t$95$1, If[LessEqual[x, 1.2e-14], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e+84], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.59999999999999969e104 or 1.85e84 < x

    1. Initial program 99.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. +-commutative99.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-define99.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-neg99.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-eval99.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-neg99.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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.59999999999999969e104 < x < 1.2e-14

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-t\right) - \log y} \]
    10. Simplified78.0%

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

    if 1.2e-14 < x < 1.85e84

    1. Initial program 76.4%

      \[\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(-0.5 \cdot y - 1\right)\right)}\right) - t \]
    4. Taylor expanded in z around inf 72.3%

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

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

Alternative 9: 66.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{+108} \lor \neg \left(x \leq 1.55 \cdot 10^{+84}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4e108 or 1.55000000000000001e84 < x

    1. Initial program 99.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. +-commutative99.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-define99.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-neg99.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-eval99.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-neg99.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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4e108 < x < 1.55000000000000001e84

    1. Initial program 84.8%

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

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

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

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

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

        \[\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 y around 0 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 99.2% accurate, 1.9× speedup?

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

\\
\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right) - t
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.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-define89.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-neg89.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-eval89.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-neg89.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.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 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 89.2% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.79999999999999969e180

    1. Initial program 46.8%

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

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

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

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

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

        \[\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 y around 0 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.79999999999999969e180 < z

    1. Initial program 93.2%

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

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) + \left(x - 1\right) \cdot \log y\right)} - t \]
      2. fma-define93.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-neg93.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-eval93.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-neg93.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 91.7%

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

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

Alternative 12: 99.1% accurate, 1.9× speedup?

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

\\
\left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.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-define89.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-neg89.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-eval89.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-neg89.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.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 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 45.9% accurate, 30.7× speedup?

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

\\
y \cdot \left(1 - z\right) - t
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.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-define89.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-neg89.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-eval89.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-neg89.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.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 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt[3]{\color{blue}{{\log y}^{3}}} \cdot \left(-1 + x\right) - y \cdot \left(-1 + z\right)\right) - t \]
  9. Applied egg-rr98.6%

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

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

Alternative 14: 45.7% 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 89.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. +-commutative89.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-define89.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-neg89.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-eval89.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-neg89.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.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 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 36.1% accurate, 107.5× speedup?

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

\\
-t
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.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-define89.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-neg89.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-eval89.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-neg89.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.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 t around inf 42.6%

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

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

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

Alternative 16: 2.3% accurate, 215.0× speedup?

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

\\
0
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.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-define89.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-neg89.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-eval89.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-neg89.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.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 t around inf 42.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  12. Taylor expanded in t around 0 2.3%

    \[\leadsto \color{blue}{1} + -1 \]
  13. Step-by-step derivation
    1. metadata-eval2.3%

      \[\leadsto \color{blue}{0} \]
  14. Applied egg-rr2.3%

    \[\leadsto \color{blue}{0} \]
  15. Add Preprocessing

Reproduce

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