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

Percentage Accurate: 89.0% → 99.6%
Time: 15.1s
Alternatives: 15
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 89.0% 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.6% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.3% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999977e37 < (-.f64 x #s(literal 1 binary64)) < -0.5

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.7× speedup?

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

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

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

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

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

Alternative 4: 95.1% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999977e37 < (-.f64 x #s(literal 1 binary64)) < -0.999999949999999971

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.5% accurate, 1.8× speedup?

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

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

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

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

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

Alternative 6: 89.8% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000057e206 < z < 1.9999999999999999e163

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e163 < z

    1. Initial program 46.0%

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

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

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

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

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

        \[\leadsto \left(\sqrt[3]{{\left(\left(x + \color{blue}{-1}\right) \cdot \log y\right)}^{3}} + y \cdot \left(-1 \cdot \left(z - 1\right) + -0.5 \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
      5. *-commutative76.8%

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

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

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

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

Alternative 7: 76.8% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.14999999999999992e37 or 175 < x

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.14999999999999992e37 < x < 175

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.9% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.0399999999999999e83 or 6.49999999999999993e33 < x

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    7. Step-by-step derivation
      1. *-commutative81.2%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    8. Simplified81.2%

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

    if -1.0399999999999999e83 < x < 6.49999999999999993e33

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 42.5% accurate, 14.3× speedup?

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

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

\mathbf{elif}\;t \leq 80000000000:\\
\;\;\;\;z \cdot \left(-y\right)\\

\mathbf{else}:\\
\;\;\;\;-1 + \left(1 - t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.50000000000000018e44

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.50000000000000018e44 < t < 8e10

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8e10 < t

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.5%

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

Alternative 11: 42.5% accurate, 15.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+44} \lor \neg \left(t \leq 580000000000\right):\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.5000000000000004e44 or 5.8e11 < t

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.5000000000000004e44 < t < 5.8e11

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 46.8% accurate, 19.5× speedup?

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt[3]{{\left(\left(x + \color{blue}{-1}\right) \cdot \log y\right)}^{3}} + y \cdot \left(-1 \cdot \left(z - 1\right) + -0.5 \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
    5. *-commutative70.8%

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

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

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

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

Alternative 13: 46.6% accurate, 35.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{z \cdot \left(-y\right)} - t \]
  12. Final simplification47.5%

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

Alternative 14: 36.0% accurate, 107.5× speedup?

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

\\
-t
\end{array}
Derivation
  1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  7. Simplified34.4%

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

Alternative 15: 2.3% accurate, 215.0× speedup?

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

\\
0
\end{array}
Derivation
  1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  7. Simplified34.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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