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

Percentage Accurate: 85.6% → 99.8%
Time: 15.0s
Alternatives: 12
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 12 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.6% 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.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{log1p}\left(-y\right), x \cdot \log y - t\right)} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 2: 99.5% accurate, 1.7× speedup?

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

\\
\left(x \cdot \log y + y \cdot \left(y \cdot \left(z \cdot -0.5 + -0.3333333333333333 \cdot \left(z \cdot y\right)\right) - z\right)\right) - t
\end{array}
Derivation
  1. Initial program 82.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.9%

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

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

Alternative 3: 86.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+75}:\\ \;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+152}:\\ \;\;\;\;x \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -7e+75)
   (- (* z (log1p (- y))) t)
   (if (<= z 4.7e+152)
     (- (* x (log y)) t)
     (- (* y (* z (+ -1.0 (* y -0.5)))) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -7e+75) {
		tmp = (z * log1p(-y)) - t;
	} else if (z <= 4.7e+152) {
		tmp = (x * log(y)) - t;
	} else {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -7e+75) {
		tmp = (z * Math.log1p(-y)) - t;
	} else if (z <= 4.7e+152) {
		tmp = (x * Math.log(y)) - t;
	} else {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -7e+75:
		tmp = (z * math.log1p(-y)) - t
	elif z <= 4.7e+152:
		tmp = (x * math.log(y)) - t
	else:
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -7e+75)
		tmp = Float64(Float64(z * log1p(Float64(-y))) - t);
	elseif (z <= 4.7e+152)
		tmp = Float64(Float64(x * log(y)) - t);
	else
		tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[z, -7e+75], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 4.7e+152], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+75}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{+152}:\\
\;\;\;\;x \cdot \log y - t\\

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


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

    1. Initial program 46.2%

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

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

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

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

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

    if -6.9999999999999997e75 < z < 4.70000000000000024e152

    1. Initial program 96.1%

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

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

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

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

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

    if 4.70000000000000024e152 < z

    1. Initial program 44.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.6% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+153}:\\
\;\;\;\;x \cdot \log y - t\\

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


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

    1. Initial program 46.2%

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left({\color{blue}{\left(-z\right)}}^{1} + y \cdot \left(z \cdot \left(-0.3333333333333333 \cdot y - 0.5\right)\right)\right) - t \]
    9. Applied egg-rr89.7%

      \[\leadsto y \cdot \left(\color{blue}{{\left(-z\right)}^{1}} + y \cdot \left(z \cdot \left(-0.3333333333333333 \cdot y - 0.5\right)\right)\right) - t \]
    10. Step-by-step derivation
      1. unpow189.7%

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

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

    if -6.9999999999999997e75 < z < 3.6000000000000001e153

    1. Initial program 96.1%

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

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

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

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

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

    if 3.6000000000000001e153 < z

    1. Initial program 44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.4% accurate, 1.8× speedup?

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

\\
\left(x \cdot \log y + y \cdot \left(-0.5 \cdot \left(z \cdot y\right) - z\right)\right) - t
\end{array}
Derivation
  1. Initial program 82.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.7%

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

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

Alternative 6: 77.0% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 98.6%

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

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

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

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

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

    if -1.15e110 < x < 7.6000000000000003e117

    1. Initial program 76.0%

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

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

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

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

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

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

      \[\leadsto y \cdot \left(-1 \cdot z + \color{blue}{y \cdot \left(z \cdot \left(-0.3333333333333333 \cdot y - 0.5\right)\right)}\right) - t \]
    8. Step-by-step derivation
      1. pow180.0%

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

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

      \[\leadsto y \cdot \left(\color{blue}{{\left(-z\right)}^{1}} + y \cdot \left(z \cdot \left(-0.3333333333333333 \cdot y - 0.5\right)\right)\right) - t \]
    10. Step-by-step derivation
      1. unpow180.0%

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

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

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

Alternative 7: 99.0% accurate, 1.9× speedup?

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

\\
\left(x \cdot \log y - z \cdot y\right) - t
\end{array}
Derivation
  1. Initial program 82.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.2%

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

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

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

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

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

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

Alternative 8: 57.5% accurate, 14.1× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \left({\color{blue}{\left(-z\right)}}^{1} + y \cdot \left(z \cdot \left(-0.3333333333333333 \cdot y - 0.5\right)\right)\right) - t \]
  9. Applied egg-rr62.6%

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

      \[\leadsto y \cdot \left(\color{blue}{\left(-z\right)} + y \cdot \left(z \cdot \left(-0.3333333333333333 \cdot y - 0.5\right)\right)\right) - t \]
  11. Simplified62.6%

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

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

Alternative 9: 47.6% accurate, 15.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{-134} \lor \neg \left(t \leq 1.5 \cdot 10^{-33}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -2.5e-134) (not (<= t 1.5e-33))) (- t) (* y (- z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -2.5e-134) || !(t <= 1.5e-33)) {
		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 <= (-2.5d-134)) .or. (.not. (t <= 1.5d-33))) 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 <= -2.5e-134) || !(t <= 1.5e-33)) {
		tmp = -t;
	} else {
		tmp = y * -z;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -2.5e-134) or not (t <= 1.5e-33):
		tmp = -t
	else:
		tmp = y * -z
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -2.5e-134) || !(t <= 1.5e-33))
		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 <= -2.5e-134) || ~((t <= 1.5e-33)))
		tmp = -t;
	else
		tmp = y * -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.5e-134], N[Not[LessEqual[t, 1.5e-33]], $MachinePrecision]], (-t), N[(y * (-z)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-134} \lor \neg \left(t \leq 1.5 \cdot 10^{-33}\right):\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5000000000000002e-134 or 1.5000000000000001e-33 < t

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

    if -2.5000000000000002e-134 < t < 1.5000000000000001e-33

    1. Initial program 69.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 98.6%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.4% accurate, 19.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 57.0% 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 82.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 42.8% 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 82.3%

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

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

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

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

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

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

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

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

Developer Target 1: 99.5% 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 2024170 
(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))