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

Percentage Accurate: 89.3% → 99.8%
Time: 24.9s
Alternatives: 27
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 27 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.3% 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 87.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. sub-neg87.6%

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

      \[\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+87.6%

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

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

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

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

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

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

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

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

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

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

\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Derivation
  1. Initial program 87.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. +-commutative87.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-define87.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-neg87.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-eval87.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-neg87.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.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), \log y \cdot \left(-1 + x\right)\right) - t \]
  6. Add Preprocessing

Alternative 3: 65.0% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\log y\\ t_2 := x \cdot \log y\\ t_3 := y \cdot \left(1 - z\right) - t\\ \mathbf{if}\;x \leq -3.7 \cdot 10^{+27}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-124}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-167}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.62 \cdot 10^{-292}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 1.06 \cdot 10^{-261}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (log y))) (t_2 (* x (log y))) (t_3 (- (* y (- 1.0 z)) t)))
   (if (<= x -3.7e+27)
     t_2
     (if (<= x -1.9e-124)
       t_3
       (if (<= x -2.9e-167)
         t_1
         (if (<= x 1.62e-292)
           t_3
           (if (<= x 1.06e-261)
             t_1
             (if (<= x 2.7e+48)
               (- (* y (* z (+ -1.0 (* y -0.5)))) t)
               t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = -log(y);
	double t_2 = x * log(y);
	double t_3 = (y * (1.0 - z)) - t;
	double tmp;
	if (x <= -3.7e+27) {
		tmp = t_2;
	} else if (x <= -1.9e-124) {
		tmp = t_3;
	} else if (x <= -2.9e-167) {
		tmp = t_1;
	} else if (x <= 1.62e-292) {
		tmp = t_3;
	} else if (x <= 1.06e-261) {
		tmp = t_1;
	} else if (x <= 2.7e+48) {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = -log(y)
    t_2 = x * log(y)
    t_3 = (y * (1.0d0 - z)) - t
    if (x <= (-3.7d+27)) then
        tmp = t_2
    else if (x <= (-1.9d-124)) then
        tmp = t_3
    else if (x <= (-2.9d-167)) then
        tmp = t_1
    else if (x <= 1.62d-292) then
        tmp = t_3
    else if (x <= 1.06d-261) then
        tmp = t_1
    else if (x <= 2.7d+48) then
        tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -Math.log(y);
	double t_2 = x * Math.log(y);
	double t_3 = (y * (1.0 - z)) - t;
	double tmp;
	if (x <= -3.7e+27) {
		tmp = t_2;
	} else if (x <= -1.9e-124) {
		tmp = t_3;
	} else if (x <= -2.9e-167) {
		tmp = t_1;
	} else if (x <= 1.62e-292) {
		tmp = t_3;
	} else if (x <= 1.06e-261) {
		tmp = t_1;
	} else if (x <= 2.7e+48) {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -math.log(y)
	t_2 = x * math.log(y)
	t_3 = (y * (1.0 - z)) - t
	tmp = 0
	if x <= -3.7e+27:
		tmp = t_2
	elif x <= -1.9e-124:
		tmp = t_3
	elif x <= -2.9e-167:
		tmp = t_1
	elif x <= 1.62e-292:
		tmp = t_3
	elif x <= 1.06e-261:
		tmp = t_1
	elif x <= 2.7e+48:
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(-log(y))
	t_2 = Float64(x * log(y))
	t_3 = Float64(Float64(y * Float64(1.0 - z)) - t)
	tmp = 0.0
	if (x <= -3.7e+27)
		tmp = t_2;
	elseif (x <= -1.9e-124)
		tmp = t_3;
	elseif (x <= -2.9e-167)
		tmp = t_1;
	elseif (x <= 1.62e-292)
		tmp = t_3;
	elseif (x <= 1.06e-261)
		tmp = t_1;
	elseif (x <= 2.7e+48)
		tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -log(y);
	t_2 = x * log(y);
	t_3 = (y * (1.0 - z)) - t;
	tmp = 0.0;
	if (x <= -3.7e+27)
		tmp = t_2;
	elseif (x <= -1.9e-124)
		tmp = t_3;
	elseif (x <= -2.9e-167)
		tmp = t_1;
	elseif (x <= 1.62e-292)
		tmp = t_3;
	elseif (x <= 1.06e-261)
		tmp = t_1;
	elseif (x <= 2.7e+48)
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = (-N[Log[y], $MachinePrecision])}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -3.7e+27], t$95$2, If[LessEqual[x, -1.9e-124], t$95$3, If[LessEqual[x, -2.9e-167], t$95$1, If[LessEqual[x, 1.62e-292], t$95$3, If[LessEqual[x, 1.06e-261], t$95$1, If[LessEqual[x, 2.7e+48], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -\log y\\
t_2 := x \cdot \log y\\
t_3 := y \cdot \left(1 - z\right) - t\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -1.9 \cdot 10^{-124}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq -2.9 \cdot 10^{-167}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.62 \cdot 10^{-292}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq 1.06 \cdot 10^{-261}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.70000000000000002e27 or 2.70000000000000004e48 < x

    1. Initial program 97.2%

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

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

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

    if -3.70000000000000002e27 < x < -1.90000000000000006e-124 or -2.90000000000000003e-167 < x < 1.61999999999999991e-292

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.90000000000000006e-124 < x < -2.90000000000000003e-167 or 1.61999999999999991e-292 < x < 1.06e-261

    1. Initial program 82.3%

      \[\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 \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right) - t} \]
    4. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
    10. Step-by-step derivation
      1. mul-1-neg82.3%

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

      \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    12. Taylor expanded in t around 0 69.6%

      \[\leadsto \color{blue}{-1 \cdot \log y} \]
    13. Step-by-step derivation
      1. mul-1-neg69.6%

        \[\leadsto \color{blue}{-\log y} \]
    14. Simplified69.6%

      \[\leadsto \color{blue}{-\log y} \]

    if 1.06e-261 < x < 2.70000000000000004e48

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

      \[\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 x around 0 98.3%

      \[\leadsto \left(\color{blue}{-1 \cdot \log y} + \left(z - 1\right) \cdot \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 \]
    5. Step-by-step derivation
      1. mul-1-neg98.3%

        \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    6. Simplified98.3%

      \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    7. Taylor expanded in y around 0 98.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.7 \cdot 10^{+27}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-124}:\\ \;\;\;\;y \cdot \left(1 - z\right) - t\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-167}:\\ \;\;\;\;-\log y\\ \mathbf{elif}\;x \leq 1.62 \cdot 10^{-292}:\\ \;\;\;\;y \cdot \left(1 - z\right) - t\\ \mathbf{elif}\;x \leq 1.06 \cdot 10^{-261}:\\ \;\;\;\;-\log y\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 52.4% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\log y\\ \mathbf{if}\;t \leq -18000:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-106}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-177}:\\ \;\;\;\;\left(-t\right) - z \cdot y\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-171}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-159}:\\ \;\;\;\;y \cdot \left(1 - z\right) - t\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-121}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (log y))))
   (if (<= t -18000.0)
     (- (* y (* z (+ -1.0 (* y -0.5)))) t)
     (if (<= t -1.35e-106)
       t_1
       (if (<= t -7e-177)
         (- (- t) (* z y))
         (if (<= t 5.2e-171)
           t_1
           (if (<= t 2e-159)
             (- (* y (- 1.0 z)) t)
             (if (<= t 1.75e-121)
               t_1
               (-
                (*
                 y
                 (*
                  z
                  (+
                   -1.0
                   (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5)))))
                t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = -log(y);
	double tmp;
	if (t <= -18000.0) {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	} else if (t <= -1.35e-106) {
		tmp = t_1;
	} else if (t <= -7e-177) {
		tmp = -t - (z * y);
	} else if (t <= 5.2e-171) {
		tmp = t_1;
	} else if (t <= 2e-159) {
		tmp = (y * (1.0 - z)) - t;
	} else if (t <= 1.75e-121) {
		tmp = t_1;
	} else {
		tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 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) :: t_1
    real(8) :: tmp
    t_1 = -log(y)
    if (t <= (-18000.0d0)) then
        tmp = (y * (z * ((-1.0d0) + (y * (-0.5d0))))) - t
    else if (t <= (-1.35d-106)) then
        tmp = t_1
    else if (t <= (-7d-177)) then
        tmp = -t - (z * y)
    else if (t <= 5.2d-171) then
        tmp = t_1
    else if (t <= 2d-159) then
        tmp = (y * (1.0d0 - z)) - t
    else if (t <= 1.75d-121) then
        tmp = t_1
    else
        tmp = (y * (z * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0))))) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -Math.log(y);
	double tmp;
	if (t <= -18000.0) {
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	} else if (t <= -1.35e-106) {
		tmp = t_1;
	} else if (t <= -7e-177) {
		tmp = -t - (z * y);
	} else if (t <= 5.2e-171) {
		tmp = t_1;
	} else if (t <= 2e-159) {
		tmp = (y * (1.0 - z)) - t;
	} else if (t <= 1.75e-121) {
		tmp = t_1;
	} else {
		tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -math.log(y)
	tmp = 0
	if t <= -18000.0:
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t
	elif t <= -1.35e-106:
		tmp = t_1
	elif t <= -7e-177:
		tmp = -t - (z * y)
	elif t <= 5.2e-171:
		tmp = t_1
	elif t <= 2e-159:
		tmp = (y * (1.0 - z)) - t
	elif t <= 1.75e-121:
		tmp = t_1
	else:
		tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(-log(y))
	tmp = 0.0
	if (t <= -18000.0)
		tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * -0.5)))) - t);
	elseif (t <= -1.35e-106)
		tmp = t_1;
	elseif (t <= -7e-177)
		tmp = Float64(Float64(-t) - Float64(z * y));
	elseif (t <= 5.2e-171)
		tmp = t_1;
	elseif (t <= 2e-159)
		tmp = Float64(Float64(y * Float64(1.0 - z)) - t);
	elseif (t <= 1.75e-121)
		tmp = t_1;
	else
		tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5))))) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -log(y);
	tmp = 0.0;
	if (t <= -18000.0)
		tmp = (y * (z * (-1.0 + (y * -0.5)))) - t;
	elseif (t <= -1.35e-106)
		tmp = t_1;
	elseif (t <= -7e-177)
		tmp = -t - (z * y);
	elseif (t <= 5.2e-171)
		tmp = t_1;
	elseif (t <= 2e-159)
		tmp = (y * (1.0 - z)) - t;
	elseif (t <= 1.75e-121)
		tmp = t_1;
	else
		tmp = (y * (z * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5))))) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = (-N[Log[y], $MachinePrecision])}, If[LessEqual[t, -18000.0], N[(N[(y * N[(z * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, -1.35e-106], t$95$1, If[LessEqual[t, -7e-177], N[((-t) - N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e-171], t$95$1, If[LessEqual[t, 2e-159], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 1.75e-121], t$95$1, N[(N[(y * N[(z * 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] - t), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -\log y\\
\mathbf{if}\;t \leq -18000:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\

\mathbf{elif}\;t \leq -1.35 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -7 \cdot 10^{-177}:\\
\;\;\;\;\left(-t\right) - z \cdot y\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-171}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.75 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -18000

    1. Initial program 91.4%

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \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 x around 0 74.2%

      \[\leadsto \left(\color{blue}{-1 \cdot \log y} + \left(z - 1\right) \cdot \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 \]
    5. Step-by-step derivation
      1. mul-1-neg74.2%

        \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    6. Simplified74.2%

      \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    7. Taylor expanded in y around 0 74.2%

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

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

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

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

    if -18000 < t < -1.35000000000000011e-106 or -7.0000000000000003e-177 < t < 5.2000000000000001e-171 or 1.99999999999999998e-159 < t < 1.74999999999999996e-121

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    12. Taylor expanded in t around 0 46.1%

      \[\leadsto \color{blue}{-1 \cdot \log y} \]
    13. Step-by-step derivation
      1. mul-1-neg46.1%

        \[\leadsto \color{blue}{-\log y} \]
    14. Simplified46.1%

      \[\leadsto \color{blue}{-\log y} \]

    if -1.35000000000000011e-106 < t < -7.0000000000000003e-177

    1. Initial program 65.4%

      \[\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 \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right) - t} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000001e-171 < t < 1.99999999999999998e-159

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.74999999999999996e-121 < t

    1. Initial program 89.5%

      \[\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 x around 0 59.5%

      \[\leadsto \left(\color{blue}{-1 \cdot \log y} + \left(z - 1\right) \cdot \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 \]
    5. Step-by-step derivation
      1. mul-1-neg59.5%

        \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    6. Simplified59.5%

      \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    7. Taylor expanded in z around inf 54.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -18000:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot -0.5\right)\right) - t\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-106}:\\ \;\;\;\;-\log y\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-177}:\\ \;\;\;\;\left(-t\right) - z \cdot y\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-171}:\\ \;\;\;\;-\log y\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-159}:\\ \;\;\;\;y \cdot \left(1 - z\right) - t\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-121}:\\ \;\;\;\;-\log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.7% accurate, 1.7× speedup?

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

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

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

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

    \[\leadsto \left(\log y \cdot \left(-1 + x\right) + \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)\right) - t \]
  5. Add Preprocessing

Alternative 6: 97.4% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.99999999999999978e119 or 3.10000000000000021e-131 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999978e119 < z < 3.10000000000000021e-131

    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. Add Preprocessing
    3. Taylor expanded in y around 0 98.8%

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

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

Alternative 7: 95.9% accurate, 1.7× speedup?

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

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

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
    11. Simplified98.1%

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

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

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 95.4%

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

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

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

Alternative 8: 99.6% accurate, 1.7× speedup?

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

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

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

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

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

Alternative 9: 94.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+120} \lor \neg \left(z \leq 0.09\right):\\
\;\;\;\;z \cdot \left(x \cdot \frac{\log y}{z} - y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2e120 or 0.089999999999999997 < z

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(\color{blue}{\frac{x \cdot \log y}{z}} - y\right) - t \]
    11. Step-by-step derivation
      1. associate-/l*95.0%

        \[\leadsto z \cdot \left(\color{blue}{x \cdot \frac{\log y}{z}} - y\right) - t \]
    12. Simplified95.0%

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

    if -2e120 < z < 0.089999999999999997

    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. Add Preprocessing
    3. Taylor expanded in y around 0 98.4%

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

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

Alternative 10: 94.0% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(\color{blue}{\frac{x \cdot \log y}{z}} - y\right) - t \]
    11. Step-by-step derivation
      1. associate-/l*97.0%

        \[\leadsto z \cdot \left(\color{blue}{x \cdot \frac{\log y}{z}} - y\right) - t \]
    12. Simplified97.0%

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

    if -5.8000000000000003e120 < z < 0.089999999999999997

    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. Add Preprocessing
    3. Taylor expanded in y around 0 98.4%

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

    if 0.089999999999999997 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(\log y \cdot \color{blue}{\frac{x}{z}} - y\right) - t \]
    11. Step-by-step derivation
      1. clear-num93.8%

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

        \[\leadsto z \cdot \left(\color{blue}{\frac{\log y}{\frac{z}{x}}} - y\right) - t \]
    12. Applied egg-rr94.0%

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

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

Alternative 11: 94.1% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(\color{blue}{\frac{x \cdot \log y}{z}} - y\right) - t \]
    11. Step-by-step derivation
      1. associate-/l*97.0%

        \[\leadsto z \cdot \left(\color{blue}{x \cdot \frac{\log y}{z}} - y\right) - t \]
    12. Simplified97.0%

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

    if -9.9999999999999998e119 < z < 0.089999999999999997

    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. Add Preprocessing
    3. Taylor expanded in y around 0 98.4%

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

    if 0.089999999999999997 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 87.1% accurate, 1.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} - t \]
    10. Step-by-step derivation
      1. *-commutative96.1%

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
    11. Simplified96.1%

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

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

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t + \left(\log y + \color{blue}{\left(-y\right)}\right)\right) \]
      2. associate-+r+75.6%

        \[\leadsto -1 \cdot \color{blue}{\left(\left(t + \log y\right) + \left(-y\right)\right)} \]
      3. distribute-lft-in75.6%

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

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

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

        \[\leadsto \color{blue}{\left(\left(-t\right) - \log y\right)} + -1 \cdot \left(-y\right) \]
      7. neg-mul-175.6%

        \[\leadsto \left(\left(-t\right) - \log y\right) + \color{blue}{\left(-\left(-y\right)\right)} \]
      8. remove-double-neg75.6%

        \[\leadsto \left(\left(-t\right) - \log y\right) + \color{blue}{y} \]
    11. Simplified75.6%

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

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

Alternative 13: 87.3% accurate, 1.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
    11. Simplified95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
    10. Step-by-step derivation
      1. mul-1-neg75.3%

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    11. Simplified75.3%

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

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

Alternative 14: 89.0% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.40000000000000012e165 < z < 6.9999999999999997e166

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

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

    if 6.9999999999999997e166 < z

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(\log y \cdot \color{blue}{\frac{x}{z}} - y\right) - t \]
    11. Taylor expanded in t around 0 81.5%

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

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

Alternative 15: 99.5% accurate, 1.8× speedup?

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

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

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

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

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

Alternative 16: 75.7% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 x #s(literal 1 binary64)) < -5.0000000000000002e70 or 5e15 < (-.f64 x #s(literal 1 binary64))

    1. Initial program 97.1%

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

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

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

    if -5.0000000000000002e70 < (-.f64 x #s(literal 1 binary64)) < 5e15

    1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 89.6% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.1999999999999996e165 < z < 2.6999999999999999e225

    1. Initial program 95.5%

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

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

    if 2.6999999999999999e225 < z

    1. Initial program 44.3%

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \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 x around 0 68.3%

      \[\leadsto \left(\color{blue}{-1 \cdot \log y} + \left(z - 1\right) \cdot \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 \]
    5. Step-by-step derivation
      1. mul-1-neg68.3%

        \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    6. Simplified68.3%

      \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
    7. Taylor expanded in z around inf 68.1%

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

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

Alternative 18: 99.2% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 46.8% accurate, 11.3× speedup?

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

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

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

    \[\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 x around 0 62.4%

    \[\leadsto \left(\color{blue}{-1 \cdot \log y} + \left(z - 1\right) \cdot \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 \]
  5. Step-by-step derivation
    1. mul-1-neg62.4%

      \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
  6. Simplified62.4%

    \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
  7. Taylor expanded in z around inf 45.4%

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

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

Alternative 20: 43.6% accurate, 14.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+14} \lor \neg \left(t \leq 5 \cdot 10^{-17}\right):\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.2e14 or 4.9999999999999999e-17 < t

    1. Initial program 92.9%

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

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

        \[\leadsto \color{blue}{-t} \]
    5. Simplified58.1%

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

    if -1.2e14 < t < 4.9999999999999999e-17

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 46.7% accurate, 14.3× speedup?

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

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

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

    \[\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 x around 0 62.4%

    \[\leadsto \left(\color{blue}{-1 \cdot \log y} + \left(z - 1\right) \cdot \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 \]
  5. Step-by-step derivation
    1. mul-1-neg62.4%

      \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
  6. Simplified62.4%

    \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
  7. Taylor expanded in y around 0 62.3%

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

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

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

Alternative 22: 43.6% accurate, 15.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -550000000 \lor \neg \left(t \leq 7600000\right):\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.5e8 or 7.6e6 < t

    1. Initial program 93.3%

      \[\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 t around inf 61.1%

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

        \[\leadsto \color{blue}{-t} \]
    5. Simplified61.1%

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

    if -5.5e8 < t < 7.6e6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -550000000 \lor \neg \left(t \leq 7600000\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 46.7% 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 87.6%

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

    \[\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 x around 0 62.4%

    \[\leadsto \left(\color{blue}{-1 \cdot \log y} + \left(z - 1\right) \cdot \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 \]
  5. Step-by-step derivation
    1. mul-1-neg62.4%

      \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
  6. Simplified62.4%

    \[\leadsto \left(\color{blue}{\left(-\log y\right)} + \left(z - 1\right) \cdot \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 \]
  7. Taylor expanded in y around 0 62.3%

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

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

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

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

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

Alternative 24: 46.6% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 25: 46.4% accurate, 35.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 26: 36.2% accurate, 107.5× speedup?

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

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

    \[\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 t around inf 32.5%

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

      \[\leadsto \color{blue}{-t} \]
  5. Simplified32.5%

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

Alternative 27: 2.8% accurate, 215.0× speedup?

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

\\
y
\end{array}
Derivation
  1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -1 \cdot \left(t + \left(\log y + \color{blue}{\left(-y\right)}\right)\right) \]
    2. associate-+r+49.2%

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

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

      \[\leadsto \color{blue}{\left(-\left(t + \log y\right)\right)} + -1 \cdot \left(-y\right) \]
    5. distribute-neg-in49.2%

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

      \[\leadsto \color{blue}{\left(\left(-t\right) - \log y\right)} + -1 \cdot \left(-y\right) \]
    7. neg-mul-149.2%

      \[\leadsto \left(\left(-t\right) - \log y\right) + \color{blue}{\left(-\left(-y\right)\right)} \]
    8. remove-double-neg49.2%

      \[\leadsto \left(\left(-t\right) - \log y\right) + \color{blue}{y} \]
  11. Simplified49.2%

    \[\leadsto \color{blue}{\left(\left(-t\right) - \log y\right) + y} \]
  12. Taylor expanded in y around inf 2.8%

    \[\leadsto \color{blue}{y} \]
  13. Add Preprocessing

Reproduce

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