Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B

Percentage Accurate: 85.7% → 99.0%
Time: 14.0s
Alternatives: 9
Speedup: 1.9×

Specification

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

\\
\left(x \cdot \log y + z \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 9 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: 85.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;t \leq -6.9 \cdot 10^{-240} \lor \neg \left(t \leq 1.35 \cdot 10^{-75}\right):\\
\;\;\;\;t\_1 - t\\

\mathbf{else}:\\
\;\;\;\;t\_1 - y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.9000000000000001e-240 or 1.3499999999999999e-75 < t

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

    if -6.9000000000000001e-240 < t < 1.3499999999999999e-75

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \log y - y \cdot z} \]
    8. Simplified94.0%

      \[\leadsto \color{blue}{x \cdot \log y - y \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.9%

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

Alternative 3: 89.5% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4999999999999999e-82 or 0.00619999999999999978 < x

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

    if -2.4999999999999999e-82 < x < 0.00619999999999999978

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 78.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+70} \lor \neg \left(x \leq 5.5 \cdot 10^{+27}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.29999999999999994e70 or 5.49999999999999966e27 < x

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

    if -2.29999999999999994e70 < x < 5.49999999999999966e27

    1. Initial program 76.6%

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

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

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

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

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

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

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

Alternative 5: 99.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

Alternative 6: 48.2% accurate, 15.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.9 \cdot 10^{-240} \lor \neg \left(t \leq 1.1 \cdot 10^{-75}\right):\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.9000000000000001e-240 or 1.10000000000000003e-75 < t

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t} \]
    8. Simplified56.8%

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

    if -6.9000000000000001e-240 < t < 1.10000000000000003e-75

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-y \cdot z} \]
      2. distribute-rgt-neg-in35.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.9 \cdot 10^{-240} \lor \neg \left(t \leq 1.1 \cdot 10^{-75}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 57.9% accurate, 35.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 43.9% accurate, 105.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 84.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  8. Simplified44.3%

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

Alternative 9: 2.2% accurate, 211.0× 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 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 84.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  8. Simplified44.3%

    \[\leadsto \color{blue}{-t} \]
  9. Step-by-step derivation
    1. add-sqr-sqrt21.7%

      \[\leadsto \color{blue}{\sqrt{-t} \cdot \sqrt{-t}} \]
    2. sqrt-unprod10.1%

      \[\leadsto \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \]
    3. sqr-neg10.1%

      \[\leadsto \sqrt{\color{blue}{t \cdot t}} \]
    4. sqrt-unprod1.2%

      \[\leadsto \color{blue}{\sqrt{t} \cdot \sqrt{t}} \]
    5. add-sqr-sqrt2.4%

      \[\leadsto \color{blue}{t} \]
    6. *-un-lft-identity2.4%

      \[\leadsto \color{blue}{1 \cdot t} \]
  10. Applied egg-rr2.4%

    \[\leadsto \color{blue}{1 \cdot t} \]
  11. Step-by-step derivation
    1. *-lft-identity2.4%

      \[\leadsto \color{blue}{t} \]
  12. Simplified2.4%

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

Developer Target 1: 99.6% accurate, 1.6× speedup?

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

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

Reproduce

?
herbie shell --seed 2024141 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
  :precision binary64

  :alt
  (! :herbie-platform default (- (* (- z) (+ (+ (* 1/2 (* y y)) y) (* (/ 1/3 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y)))))

  (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))