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

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

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

Initial Program: 89.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.7× speedup?

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

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

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

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

Alternative 4: 95.0% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -2 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \log y - t\\

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

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


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

    1. Initial program 99.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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \left(-\color{blue}{\left(-1 + z\right)}\right) - \log y\right) - t \]
      6. distribute-neg-in98.1%

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

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

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

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

    1. Initial program 99.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. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.6% accurate, 1.7× speedup?

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

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

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

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

Alternative 6: 99.4% accurate, 1.8× speedup?

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

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

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

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

Alternative 7: 87.0% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 98.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. +-commutative98.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.4e21 < x < 1

    1. Initial program 83.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. +-commutative83.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    8. Simplified82.1%

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

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

Alternative 8: 78.0% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.51999999999999991e87 or 310 < t

    1. Initial program 94.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 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(y \cdot \left(-0.25 \cdot y - 0.3333333333333333\right) - 0.5\right) - 1\right)\right)}\right) - t \]
    4. Taylor expanded in y around 0 99.8%

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

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

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

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

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

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

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

    if -1.51999999999999991e87 < t < 310

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 76.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+65} \lor \neg \left(x \leq 3.9 \cdot 10^{+18}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5000000000000001e65 or 3.9e18 < x

    1. Initial program 99.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. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \left(t \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(x - 1\right)}{t}\right)\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg76.4%

        \[\leadsto \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \color{blue}{-t \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(x - 1\right)}{t}\right)}\right) \]
      2. distribute-rgt-neg-in76.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    9. Step-by-step derivation
      1. *-commutative77.6%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    10. Simplified77.6%

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

    if -1.5000000000000001e65 < x < 3.9e18

    1. Initial program 84.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. +-commutative84.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    8. Simplified79.7%

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

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

Alternative 10: 89.4% accurate, 1.9× speedup?

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

    1. Initial program 92.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. +-commutative92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-z \cdot -1\right)} \cdot \left(\log \left(1 - y\right) + \frac{-1 \cdot \log \left(1 - y\right) + \log y \cdot \left(x - 1\right)}{z}\right) - t \]
      7. distribute-rgt-neg-in81.2%

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\mathsf{log1p}\left(-y\right) + \frac{\mathsf{fma}\left(\log y, -1 + x, -\mathsf{log1p}\left(-y\right)\right)}{z}\right)} - t \]
    8. Step-by-step derivation
      1. clear-num88.3%

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

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

      \[\leadsto z \cdot \left(\mathsf{log1p}\left(-y\right) + \color{blue}{{\left(\frac{z}{\mathsf{fma}\left(\log y, -1 + x, -\mathsf{log1p}\left(-y\right)\right)}\right)}^{-1}}\right) - t \]
    10. Step-by-step derivation
      1. unpow-188.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999991e238 < z

    1. Initial program 45.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 + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(y \cdot \left(-0.25 \cdot y - 0.3333333333333333\right) - 0.5\right) - 1\right)\right)}\right) - t \]
    4. Taylor expanded in y around 0 100.0%

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

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

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

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

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

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

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

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

Alternative 11: 66.5% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+65} \lor \neg \left(x \leq 1.2 \cdot 10^{+24}\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.4e+65) (not (<= x 1.2e+24)))
   (* 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.4e+65) || !(x <= 1.2e+24)) {
		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.4d+65)) .or. (.not. (x <= 1.2d+24))) 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.4e+65) || !(x <= 1.2e+24)) {
		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.4e+65) or not (x <= 1.2e+24):
		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.4e+65) || !(x <= 1.2e+24))
		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.4e+65) || ~((x <= 1.2e+24)))
		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.4e+65], N[Not[LessEqual[x, 1.2e+24]], $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.4 \cdot 10^{+65} \lor \neg \left(x \leq 1.2 \cdot 10^{+24}\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.3999999999999999e65 or 1.2e24 < x

    1. Initial program 99.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. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \left(t \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(x - 1\right)}{t}\right)\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg76.4%

        \[\leadsto \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \color{blue}{-t \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(x - 1\right)}{t}\right)}\right) \]
      2. distribute-rgt-neg-in76.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    9. Step-by-step derivation
      1. *-commutative77.6%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    10. Simplified77.6%

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

    if -1.3999999999999999e65 < x < 1.2e24

    1. Initial program 84.7%

      \[\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 + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(y \cdot \left(-0.25 \cdot y - 0.3333333333333333\right) - 0.5\right) - 1\right)\right)}\right) - t \]
    4. Taylor expanded in y around 0 99.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+65} \lor \neg \left(x \leq 1.2 \cdot 10^{+24}\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 12: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 89.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.5 \cdot 10^{+229}:\\
\;\;\;\;\left(-1 + x\right) \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 z < 4.50000000000000023e229

    1. Initial program 92.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. +-commutative92.7%

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

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

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

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

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

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

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

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

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

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

    if 4.50000000000000023e229 < z

    1. Initial program 45.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 + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(y \cdot \left(-0.25 \cdot y - 0.3333333333333333\right) - 0.5\right) - 1\right)\right)}\right) - t \]
    4. Taylor expanded in y around 0 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 4.5 \cdot 10^{+229}:\\ \;\;\;\;\left(-1 + x\right) \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 14: 42.4% accurate, 11.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-14}:\\
\;\;\;\;1 + \left(-1 - t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.44999999999999997e-14

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
    12. Step-by-step derivation
      1. associate-+l-56.6%

        \[\leadsto \color{blue}{1 - \left(t - -1\right)} \]
    13. Applied egg-rr56.6%

      \[\leadsto \color{blue}{1 - \left(t - -1\right)} \]

    if -2.44999999999999997e-14 < t < 1.7000000000000001e30

    1. Initial program 85.9%

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

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

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

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

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

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

    if 1.7000000000000001e30 < t

    1. Initial program 98.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. +-commutative98.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.4%

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

Alternative 15: 46.0% 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 91.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.5%

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

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

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

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

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

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

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

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

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

Alternative 16: 35.7% accurate, 107.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 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 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 2024137 
(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))