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

Percentage Accurate: 88.6% → 99.8%
Time: 16.1s
Alternatives: 15
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 88.6% 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(x + -1\right) - t\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (fma (+ z -1.0) (log1p (- y)) (- (* (log y) (+ x -1.0)) t)))
double code(double x, double y, double z, double t) {
	return fma((z + -1.0), log1p(-y), ((log(y) * (x + -1.0)) - t));
}
function code(x, y, z, t)
	return fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(log(y) * Float64(x + -1.0)) - t))
end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.3% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.9× speedup?

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

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

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. 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(-1 \cdot y\right)}\right) - t \]
  3. Step-by-step derivation
    1. mul-1-neg99.1%

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

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

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

Alternative 6: 55.0% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;t \leq -1.05 \cdot 10^{-195}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.25 \cdot 10^{+69}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.7500000000000001e48 or 1.25000000000000009e69 < t

    1. Initial program 97.2%

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

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

        \[\leadsto \color{blue}{-t} \]
    4. Simplified80.0%

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

    if -2.7500000000000001e48 < t < -1.05e-195 or -1.08e-287 < t < 1.25000000000000009e69

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

    if -1.05e-195 < t < -1.08e-287

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(z + \color{blue}{-1}\right) \cdot {y}^{2}\right) \cdot -0.5 + -1 \cdot \left(\left(z - 1\right) \cdot y\right) \]
      5. associate-*l*43.8%

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

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right) \]
      7. associate-*r*43.8%

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

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

        \[\leadsto \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right)\right) + \left(-\color{blue}{\left(z + \left(-1\right)\right)} \cdot y\right) \]
      10. metadata-eval43.8%

        \[\leadsto \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right)\right) + \left(-\left(z + \color{blue}{-1}\right) \cdot y\right) \]
      11. distribute-rgt-neg-in43.8%

        \[\leadsto \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right)\right) + \color{blue}{\left(z + -1\right) \cdot \left(-y\right)} \]
      12. distribute-lft-in43.9%

        \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right) + \left(-y\right)\right)} \]
      13. associate-*r*43.9%

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right) \cdot -0.5} + \left(-y\right)\right) \]
      14. unpow243.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.75 \cdot 10^{+48}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-195}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;t \leq -1.08 \cdot 10^{-287}:\\ \;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+69}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]

Alternative 7: 87.6% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.2499999999999999e133

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2499999999999999e133 < z

    1. Initial program 46.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}} + \mathsf{log1p}\left(-y\right) \cdot z\right) - t \]
      3. associate-*r/89.7%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\frac{\log y \cdot \mathsf{fma}\left(x, x, -1\right)}{1 + x}} + \mathsf{log1p}\left(-y\right) \cdot z\right) - t \]
    7. Step-by-step derivation
      1. associate-/l*89.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.25 \cdot 10^{+133}:\\ \;\;\;\;\left(y + \log y \cdot \left(x + -1\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\ \end{array} \]

Alternative 8: 99.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 86.5% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25e11 or 1 < x

    1. Initial program 90.0%

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

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

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

    if -1.25e11 < x < 1

    1. Initial program 83.9%

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

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

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

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

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

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

Alternative 10: 75.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+48}:\\
\;\;\;\;-t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.1000000000000003e48 or 3.4999999999999997e66 < t

    1. Initial program 97.2%

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

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

        \[\leadsto \color{blue}{-t} \]
    4. Simplified80.0%

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

    if -4.1000000000000003e48 < t < 3.4999999999999997e66

    1. Initial program 80.4%

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

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

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

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

Alternative 11: 87.5% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.2499999999999999e133

    1. Initial program 93.9%

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

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

    if 1.2499999999999999e133 < z

    1. Initial program 46.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}} + \mathsf{log1p}\left(-y\right) \cdot z\right) - t \]
      3. associate-*r/89.7%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\frac{\log y \cdot \mathsf{fma}\left(x, x, -1\right)}{1 + x}} + \mathsf{log1p}\left(-y\right) \cdot z\right) - t \]
    7. Step-by-step derivation
      1. associate-/l*89.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.25 \cdot 10^{+133}:\\ \;\;\;\;\log y \cdot \left(x + -1\right) - t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\ \end{array} \]

Alternative 12: 74.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1350000000000 \lor \neg \left(x \leq 1.9 \cdot 10^{+97}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.35e12 or 1.90000000000000018e97 < x

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

    if -1.35e12 < x < 1.90000000000000018e97

    1. Initial program 83.2%

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

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

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

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

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

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

Alternative 13: 41.4% accurate, 14.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+48}:\\
\;\;\;\;-t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.55000000000000003e48 or 1.4000000000000001e61 < t

    1. Initial program 97.3%

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

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

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

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

    if -1.55000000000000003e48 < t < 1.4000000000000001e61

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(z + \color{blue}{-1}\right) \cdot {y}^{2}\right) \cdot -0.5 + -1 \cdot \left(\left(z - 1\right) \cdot y\right) \]
      5. associate-*l*23.0%

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

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right) \]
      7. associate-*r*23.0%

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot -0.5\right)\right)} + -1 \cdot \left(\left(z - 1\right) \cdot y\right) \]
      8. mul-1-neg23.0%

        \[\leadsto \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right)\right) + \color{blue}{\left(-\left(z - 1\right) \cdot y\right)} \]
      9. sub-neg23.0%

        \[\leadsto \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right)\right) + \left(-\color{blue}{\left(z + \left(-1\right)\right)} \cdot y\right) \]
      10. metadata-eval23.0%

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

        \[\leadsto \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right)\right) + \color{blue}{\left(z + -1\right) \cdot \left(-y\right)} \]
      12. distribute-lft-in23.0%

        \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right) + \left(-y\right)\right)} \]
      13. associate-*r*23.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.55 \cdot 10^{+48}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+61}:\\ \;\;\;\;\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]

Alternative 14: 41.1% accurate, 16.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+48}:\\
\;\;\;\;-t\\

\mathbf{elif}\;t \leq 1.4 \cdot 10^{+61}:\\
\;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.55000000000000003e48 or 1.4000000000000001e61 < t

    1. Initial program 97.3%

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

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

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

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

    if -1.55000000000000003e48 < t < 1.4000000000000001e61

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.55 \cdot 10^{+48}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+61}:\\ \;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]

Alternative 15: 35.2% 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 86.9%

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

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

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

    \[\leadsto \color{blue}{-t} \]
  5. Final simplification33.8%

    \[\leadsto -t \]

Reproduce

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