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

Percentage Accurate: 89.6% → 99.8%
Time: 17.0s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 89.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 91.2%

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

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

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

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

      \[\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, 0.9× speedup?

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

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

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

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

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
  5. Step-by-step derivation
    1. fma-udef99.7%

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

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

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

    \[\leadsto \left(\log y \cdot \left(x + -1\right) + \left(\left(-0.5 \cdot \left(y \cdot \left(y \cdot \left(z + -1\right)\right)\right) + {y}^{3} \cdot \left(0.3333333333333333 + z \cdot -0.3333333333333333\right)\right) + y \cdot \left(1 - z\right)\right)\right) - t \]

Alternative 3: 99.5% accurate, 1.7× speedup?

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

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

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

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

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
  5. Taylor expanded in y around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.5% accurate, 1.7× speedup?

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

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

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

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

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
  5. Taylor expanded in y around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.3% accurate, 1.8× speedup?

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

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

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

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

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
  5. Taylor expanded in y around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.4% 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 91.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 z around inf 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 7: 95.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+183} \lor \neg \left(z \leq 2.2 \cdot 10^{+176}\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.99999999999999979e183 or 2.20000000000000007e176 < z

    1. Initial program 62.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 z around inf 62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999979e183 < z < 2.20000000000000007e176

    1. Initial program 97.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 y around 0 96.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+183} \lor \neg \left(z \leq 2.2 \cdot 10^{+176}\right):\\ \;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot \left(x + -1\right) - t\\ \end{array} \]

Alternative 8: 99.3% accurate, 1.9× speedup?

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

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

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

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

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
  5. Taylor expanded in y around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 99.2% 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 91.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 z around inf 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 76.4% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.49999999999999986e33 or 20 < x

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

    if -2.49999999999999986e33 < x < 20

    1. Initial program 85.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 100.0%

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

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

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
    5. Taylor expanded in y around 0 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
      5. associate-*r*56.4%

        \[\leadsto z \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} + \left(-y\right)\right) - t \]
      6. neg-mul-156.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+33} \lor \neg \left(x \leq 20\right):\\ \;\;\;\;x \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \end{array} \]

Alternative 11: 89.4% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 93.8%

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

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

    if 1.10000000000000001e244 < z

    1. Initial program 50.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 y around 0 99.9%

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

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

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
    5. Taylor expanded in y around 0 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right) \cdot z} - t \]
    9. Step-by-step derivation
      1. *-commutative78.7%

        \[\leadsto \color{blue}{z \cdot \left(-0.5 \cdot {y}^{2} - y\right)} - t \]
      2. sub-neg78.7%

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

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

        \[\leadsto z \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
      5. associate-*r*78.7%

        \[\leadsto z \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} + \left(-y\right)\right) - t \]
      6. neg-mul-178.7%

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

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

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

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

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

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

Alternative 12: 66.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+47} \lor \neg \left(x \leq 1.2 \cdot 10^{+16}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4499999999999999e47 or 1.2e16 < x

    1. Initial program 97.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 97.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\log y \cdot x} - t \]
    6. Taylor expanded in x around inf 81.3%

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

    if -1.4499999999999999e47 < x < 1.2e16

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

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

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

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
    5. Taylor expanded in y around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right) \cdot z} - t \]
    9. Step-by-step derivation
      1. *-commutative56.8%

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

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

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

        \[\leadsto z \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
      5. associate-*r*56.8%

        \[\leadsto z \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} + \left(-y\right)\right) - t \]
      6. neg-mul-156.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+47} \lor \neg \left(x \leq 1.2 \cdot 10^{+16}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \end{array} \]

Alternative 13: 46.4% accurate, 19.5× speedup?

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

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

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

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

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \color{blue}{\left(\mathsf{fma}\left(-0.5, y \cdot \left(y \cdot \left(-1 + z\right)\right), {y}^{3} \cdot \left(0.3333333333333333 + -0.3333333333333333 \cdot z\right)\right) - y \cdot \left(-1 + z\right)\right)}\right) - t \]
  5. Taylor expanded in y around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right) \cdot z} - t \]
  9. Step-by-step derivation
    1. *-commutative39.3%

      \[\leadsto \color{blue}{z \cdot \left(-0.5 \cdot {y}^{2} - y\right)} - t \]
    2. sub-neg39.3%

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

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

      \[\leadsto z \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
    5. associate-*r*39.3%

      \[\leadsto z \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} + \left(-y\right)\right) - t \]
    6. neg-mul-139.3%

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

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

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

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

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

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

Alternative 14: 36.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 91.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 30.9%

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

      \[\leadsto \color{blue}{-t} \]
  4. Simplified30.9%

    \[\leadsto \color{blue}{-t} \]
  5. Final simplification30.9%

    \[\leadsto -t \]

Reproduce

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