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

Percentage Accurate: 89.7% → 99.5%
Time: 13.3s
Alternatives: 15
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 89.7% 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.5% accurate, 1.6× speedup?

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)\right)}\right) - t \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
    2. lower-*.f64N/A

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
    3. lower--.f64N/A

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\color{blue}{\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)} \cdot y\right)\right) - t \]
    4. *-commutativeN/A

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
    5. lower-*.f64N/A

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
    6. lower--.f64N/A

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

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

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

Alternative 2: 99.5% accurate, 1.6× speedup?

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

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

    \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + y \cdot \left(\frac{-1}{2} \cdot \left(z - 1\right) + \frac{-1}{3} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
  4. Step-by-step derivation
    1. +-commutativeN/A

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

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

Alternative 3: 99.4% accurate, 1.7× speedup?

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

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

    \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
  4. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right)} - t \]
    2. remove-double-negN/A

      \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot \left(x - 1\right)\right)\right)\right)\right)} + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
    3. distribute-lft-neg-outN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(x - 1\right)}\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
    4. log-recN/A

      \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)} \cdot \left(x - 1\right)\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
    5. mul-1-negN/A

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

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

Alternative 4: 96.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-10} \lor \neg \left(x \leq 9.5 \cdot 10^{-6}\right):\\ \;\;\;\;\left(-1 + x\right) \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;-\left(\mathsf{fma}\left(z - 1, y, \log y\right) + t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -4e-10) (not (<= x 9.5e-6)))
   (- (* (+ -1.0 x) (log y)) t)
   (- (+ (fma (- z 1.0) y (log y)) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4e-10) || !(x <= 9.5e-6)) {
		tmp = ((-1.0 + x) * log(y)) - t;
	} else {
		tmp = -(fma((z - 1.0), y, log(y)) + t);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -4e-10) || !(x <= 9.5e-6))
		tmp = Float64(Float64(Float64(-1.0 + x) * log(y)) - t);
	else
		tmp = Float64(-Float64(fma(Float64(z - 1.0), y, log(y)) + t));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4e-10], N[Not[LessEqual[x, 9.5e-6]], $MachinePrecision]], N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], (-N[(N[(N[(z - 1.0), $MachinePrecision] * y + N[Log[y], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision])]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;-\left(\mathsf{fma}\left(z - 1, y, \log y\right) + t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.00000000000000015e-10 or 9.5000000000000005e-6 < x

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

      \[\leadsto \color{blue}{\log y \cdot \left(x - 1\right)} - t \]
    4. Step-by-step derivation
      1. remove-double-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y\right)\right)\right)\right)} \cdot \left(x - 1\right) - t \]
      2. log-recN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot \left(x - 1\right) - t \]
      3. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} \cdot \left(x - 1\right) - t \]
      4. distribute-rgt-out--N/A

        \[\leadsto \color{blue}{\left(x \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right)} - t \]
      5. mul-1-negN/A

        \[\leadsto \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
      6. log-recN/A

        \[\leadsto \left(x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
      7. remove-double-negN/A

        \[\leadsto \left(x \cdot \color{blue}{\log y} - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right)} - t \]
      9. metadata-evalN/A

        \[\leadsto \left(x \cdot \log y + \color{blue}{-1} \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
      10. mul-1-negN/A

        \[\leadsto \left(x \cdot \log y + -1 \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)}\right) - t \]
      11. log-recN/A

        \[\leadsto \left(x \cdot \log y + -1 \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right)\right) - t \]
      12. remove-double-negN/A

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

        \[\leadsto \color{blue}{\left(-1 \cdot \log y + x \cdot \log y\right)} - t \]
      14. distribute-rgt-outN/A

        \[\leadsto \color{blue}{\log y \cdot \left(-1 + x\right)} - t \]
      15. remove-double-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y\right)\right)\right)\right)} \cdot \left(-1 + x\right) - t \]
      16. log-recN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot \left(-1 + x\right) - t \]
      17. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} \cdot \left(-1 + x\right) - t \]
      18. *-commutativeN/A

        \[\leadsto \color{blue}{\left(-1 + x\right) \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} - t \]
      19. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-1 + x\right) \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} - t \]
      20. lower-+.f64N/A

        \[\leadsto \color{blue}{\left(-1 + x\right)} \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) - t \]
      21. mul-1-negN/A

        \[\leadsto \left(-1 + x\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} - t \]
      22. log-recN/A

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

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

    if -4.00000000000000015e-10 < x < 9.5000000000000005e-6

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

      \[\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. associate--l+N/A

        \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
      2. associate-*r*N/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot \left(z - 1\right) + \left(\log y \cdot \left(x - 1\right) - t\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)} \]
      5. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{-y}, z - 1, \log y \cdot \left(x - 1\right) - t\right) \]
      6. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z - 1}, \log y \cdot \left(x - 1\right) - t\right) \]
      7. *-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right) - \color{blue}{t \cdot 1}\right) \]
      8. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \left(-\mathsf{fma}\left(z - 1, y, \log y\right)\right) - \color{blue}{t} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification96.8%

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

    Alternative 5: 87.6% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x - 1 \leq -40000000 \lor \neg \left(x - 1 \leq -0.5\right):\\ \;\;\;\;\log y \cdot x - t\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (or (<= (- x 1.0) -40000000.0) (not (<= (- x 1.0) -0.5)))
       (- (* (log y) x) t)
       (- (- y (log y)) t)))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (((x - 1.0) <= -40000000.0) || !((x - 1.0) <= -0.5)) {
    		tmp = (log(y) * x) - 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 (((x - 1.0d0) <= (-40000000.0d0)) .or. (.not. ((x - 1.0d0) <= (-0.5d0)))) then
            tmp = (log(y) * x) - 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 (((x - 1.0) <= -40000000.0) || !((x - 1.0) <= -0.5)) {
    		tmp = (Math.log(y) * x) - t;
    	} else {
    		tmp = (y - Math.log(y)) - t;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if ((x - 1.0) <= -40000000.0) or not ((x - 1.0) <= -0.5):
    		tmp = (math.log(y) * x) - t
    	else:
    		tmp = (y - math.log(y)) - t
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if ((Float64(x - 1.0) <= -40000000.0) || !(Float64(x - 1.0) <= -0.5))
    		tmp = Float64(Float64(log(y) * x) - t);
    	else
    		tmp = Float64(Float64(y - log(y)) - t);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (((x - 1.0) <= -40000000.0) || ~(((x - 1.0) <= -0.5)))
    		tmp = (log(y) * x) - t;
    	else
    		tmp = (y - log(y)) - t;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x - 1.0), $MachinePrecision], -40000000.0], N[Not[LessEqual[N[(x - 1.0), $MachinePrecision], -0.5]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x - 1 \leq -40000000 \lor \neg \left(x - 1 \leq -0.5\right):\\
    \;\;\;\;\log y \cdot x - t\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(y - \log y\right) - t\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 x #s(literal 1 binary64)) < -4e7 or -0.5 < (-.f64 x #s(literal 1 binary64))

      1. Initial program 95.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 x around inf

        \[\leadsto \color{blue}{x \cdot \log y} - t \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\log y \cdot x} - t \]
        2. remove-double-negN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y\right)\right)\right)\right)} \cdot x - t \]
        3. log-recN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot x - t \]
        4. mul-1-negN/A

          \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} \cdot x - t \]
        5. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x} - t \]
        6. mul-1-negN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} \cdot x - t \]
        7. log-recN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) \cdot x - t \]
        8. remove-double-negN/A

          \[\leadsto \color{blue}{\log y} \cdot x - t \]
        9. lower-log.f6495.3

          \[\leadsto \color{blue}{\log y} \cdot x - t \]
      5. Applied rewrites95.3%

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

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

      1. Initial program 82.8%

        \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
      2. Add Preprocessing
      3. Taylor expanded in y around 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. associate--l+N/A

          \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
        2. associate-*r*N/A

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot \left(z - 1\right) + \left(\log y \cdot \left(x - 1\right) - t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)} \]
        5. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{-y}, z - 1, \log y \cdot \left(x - 1\right) - t\right) \]
        6. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z - 1}, \log y \cdot \left(x - 1\right) - t\right) \]
        7. *-rgt-identityN/A

          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right) - \color{blue}{t \cdot 1}\right) \]
        8. fp-cancel-sub-sign-invN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\log y, x - 1, y\right) - \color{blue}{t} \]
        2. Taylor expanded in x around 0

          \[\leadsto \left(y + -1 \cdot \log y\right) - t \]
        3. Step-by-step derivation
          1. Applied rewrites78.6%

            \[\leadsto \left(y - \log y\right) - t \]
        4. Recombined 2 regimes into one program.
        5. Final simplification87.6%

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

        Alternative 6: 76.5% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -1.5 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-37}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+58}:\\ \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* (log y) x)))
           (if (<= x -1.5e+22)
             t_1
             (if (<= x 2.4e-37)
               (- (- y (log y)) t)
               (if (<= x 1.5e+58) (- (* (* (- (* -0.5 y) 1.0) z) y) t) t_1)))))
        double code(double x, double y, double z, double t) {
        	double t_1 = log(y) * x;
        	double tmp;
        	if (x <= -1.5e+22) {
        		tmp = t_1;
        	} else if (x <= 2.4e-37) {
        		tmp = (y - log(y)) - t;
        	} else if (x <= 1.5e+58) {
        		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
        	} else {
        		tmp = t_1;
        	}
        	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) * x
            if (x <= (-1.5d+22)) then
                tmp = t_1
            else if (x <= 2.4d-37) then
                tmp = (y - log(y)) - t
            else if (x <= 1.5d+58) then
                tmp = (((((-0.5d0) * y) - 1.0d0) * z) * y) - t
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = Math.log(y) * x;
        	double tmp;
        	if (x <= -1.5e+22) {
        		tmp = t_1;
        	} else if (x <= 2.4e-37) {
        		tmp = (y - Math.log(y)) - t;
        	} else if (x <= 1.5e+58) {
        		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = math.log(y) * x
        	tmp = 0
        	if x <= -1.5e+22:
        		tmp = t_1
        	elif x <= 2.4e-37:
        		tmp = (y - math.log(y)) - t
        	elif x <= 1.5e+58:
        		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(log(y) * x)
        	tmp = 0.0
        	if (x <= -1.5e+22)
        		tmp = t_1;
        	elseif (x <= 2.4e-37)
        		tmp = Float64(Float64(y - log(y)) - t);
        	elseif (x <= 1.5e+58)
        		tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = log(y) * x;
        	tmp = 0.0;
        	if (x <= -1.5e+22)
        		tmp = t_1;
        	elseif (x <= 2.4e-37)
        		tmp = (y - log(y)) - t;
        	elseif (x <= 1.5e+58)
        		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.5e+22], t$95$1, If[LessEqual[x, 2.4e-37], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 1.5e+58], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \log y \cdot x\\
        \mathbf{if}\;x \leq -1.5 \cdot 10^{+22}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq 2.4 \cdot 10^{-37}:\\
        \;\;\;\;\left(y - \log y\right) - t\\
        
        \mathbf{elif}\;x \leq 1.5 \cdot 10^{+58}:\\
        \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if x < -1.5e22 or 1.5000000000000001e58 < x

          1. Initial program 96.6%

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

            \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)\right)}\right) - t \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
            2. lower-*.f64N/A

              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
            3. lower--.f64N/A

              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\color{blue}{\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)} \cdot y\right)\right) - t \]
            4. *-commutativeN/A

              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
            5. lower-*.f64N/A

              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
            6. lower--.f64N/A

              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right)} \cdot y - 1\right) \cdot y\right)\right) - t \]
            7. lower-*.f6499.6

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - x, \left(x - 1\right) \cdot \frac{\log y}{1 - x}, \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y - 1\right) \cdot y\right) \cdot \left(z - 1\right) - t\right)} \]
          7. Taylor expanded in x around inf

            \[\leadsto \color{blue}{x \cdot \log y} \]
          8. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\log y \cdot x} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\log y \cdot x} \]
            3. lower-log.f6477.4

              \[\leadsto \color{blue}{\log y} \cdot x \]
          9. Applied rewrites77.4%

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

          if -1.5e22 < x < 2.39999999999999991e-37

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

            \[\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. associate--l+N/A

              \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
            2. associate-*r*N/A

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot \left(z - 1\right) + \left(\log y \cdot \left(x - 1\right) - t\right) \]
            4. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)} \]
            5. lower-neg.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{-y}, z - 1, \log y \cdot \left(x - 1\right) - t\right) \]
            6. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z - 1}, \log y \cdot \left(x - 1\right) - t\right) \]
            7. *-rgt-identityN/A

              \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right) - \color{blue}{t \cdot 1}\right) \]
            8. fp-cancel-sub-sign-invN/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\log y, x - 1, y\right) - \color{blue}{t} \]
            2. Taylor expanded in x around 0

              \[\leadsto \left(y + -1 \cdot \log y\right) - t \]
            3. Step-by-step derivation
              1. Applied rewrites80.6%

                \[\leadsto \left(y - \log y\right) - t \]

              if 2.39999999999999991e-37 < x < 1.5000000000000001e58

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

                \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right)} - t \]
                2. remove-double-negN/A

                  \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot \left(x - 1\right)\right)\right)\right)\right)} + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                3. distribute-lft-neg-outN/A

                  \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(x - 1\right)}\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                4. log-recN/A

                  \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)} \cdot \left(x - 1\right)\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                5. mul-1-negN/A

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

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

                \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
              7. Step-by-step derivation
                1. Applied rewrites71.0%

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

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

              Alternative 7: 76.4% accurate, 1.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -1.5 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-37}:\\ \;\;\;\;-\left(\log y + t\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+58}:\\ \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (* (log y) x)))
                 (if (<= x -1.5e+22)
                   t_1
                   (if (<= x 2.4e-37)
                     (- (+ (log y) t))
                     (if (<= x 1.5e+58) (- (* (* (- (* -0.5 y) 1.0) z) y) t) t_1)))))
              double code(double x, double y, double z, double t) {
              	double t_1 = log(y) * x;
              	double tmp;
              	if (x <= -1.5e+22) {
              		tmp = t_1;
              	} else if (x <= 2.4e-37) {
              		tmp = -(log(y) + t);
              	} else if (x <= 1.5e+58) {
              		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
              	} else {
              		tmp = t_1;
              	}
              	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) * x
                  if (x <= (-1.5d+22)) then
                      tmp = t_1
                  else if (x <= 2.4d-37) then
                      tmp = -(log(y) + t)
                  else if (x <= 1.5d+58) then
                      tmp = (((((-0.5d0) * y) - 1.0d0) * z) * y) - t
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double t_1 = Math.log(y) * x;
              	double tmp;
              	if (x <= -1.5e+22) {
              		tmp = t_1;
              	} else if (x <= 2.4e-37) {
              		tmp = -(Math.log(y) + t);
              	} else if (x <= 1.5e+58) {
              		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = math.log(y) * x
              	tmp = 0
              	if x <= -1.5e+22:
              		tmp = t_1
              	elif x <= 2.4e-37:
              		tmp = -(math.log(y) + t)
              	elif x <= 1.5e+58:
              		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(log(y) * x)
              	tmp = 0.0
              	if (x <= -1.5e+22)
              		tmp = t_1;
              	elseif (x <= 2.4e-37)
              		tmp = Float64(-Float64(log(y) + t));
              	elseif (x <= 1.5e+58)
              		tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t);
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = log(y) * x;
              	tmp = 0.0;
              	if (x <= -1.5e+22)
              		tmp = t_1;
              	elseif (x <= 2.4e-37)
              		tmp = -(log(y) + t);
              	elseif (x <= 1.5e+58)
              		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.5e+22], t$95$1, If[LessEqual[x, 2.4e-37], (-N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), If[LessEqual[x, 1.5e+58], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \log y \cdot x\\
              \mathbf{if}\;x \leq -1.5 \cdot 10^{+22}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;x \leq 2.4 \cdot 10^{-37}:\\
              \;\;\;\;-\left(\log y + t\right)\\
              
              \mathbf{elif}\;x \leq 1.5 \cdot 10^{+58}:\\
              \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if x < -1.5e22 or 1.5000000000000001e58 < x

                1. Initial program 96.6%

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

                  \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)\right)}\right) - t \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
                  3. lower--.f64N/A

                    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\color{blue}{\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)} \cdot y\right)\right) - t \]
                  4. *-commutativeN/A

                    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
                  5. lower-*.f64N/A

                    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
                  6. lower--.f64N/A

                    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right)} \cdot y - 1\right) \cdot y\right)\right) - t \]
                  7. lower-*.f6499.6

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(1 - x, \left(x - 1\right) \cdot \frac{\log y}{1 - x}, \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y - 1\right) \cdot y\right) \cdot \left(z - 1\right) - t\right)} \]
                7. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{x \cdot \log y} \]
                8. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\log y \cdot x} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\log y \cdot x} \]
                  3. lower-log.f6477.4

                    \[\leadsto \color{blue}{\log y} \cdot x \]
                9. Applied rewrites77.4%

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

                if -1.5e22 < x < 2.39999999999999991e-37

                1. Initial program 85.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. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\color{blue}{\left(x - 1\right) \cdot \log y} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  2. lift--.f64N/A

                    \[\leadsto \left(\color{blue}{\left(x - 1\right)} \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  3. flip--N/A

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

                    \[\leadsto \left(\color{blue}{\frac{\left(x \cdot x - 1 \cdot 1\right) \cdot \log y}{x + 1}} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  5. lower-/.f64N/A

                    \[\leadsto \left(\color{blue}{\frac{\left(x \cdot x - 1 \cdot 1\right) \cdot \log y}{x + 1}} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\frac{\color{blue}{\left(x \cdot x - 1 \cdot 1\right) \cdot \log y}}{x + 1} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  7. difference-of-squares-revN/A

                    \[\leadsto \left(\frac{\color{blue}{\left(\left(x + 1\right) \cdot \left(x - 1\right)\right)} \cdot \log y}{x + 1} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  8. difference-of-sqr--1-revN/A

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

                    \[\leadsto \left(\frac{\left(x \cdot x + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \cdot \log y}{x + 1} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  10. lower-fma.f64N/A

                    \[\leadsto \left(\frac{\color{blue}{\mathsf{fma}\left(x, x, \mathsf{neg}\left(1\right)\right)} \cdot \log y}{x + 1} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  11. metadata-evalN/A

                    \[\leadsto \left(\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right) \cdot \log y}{x + 1} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  12. +-commutativeN/A

                    \[\leadsto \left(\frac{\mathsf{fma}\left(x, x, -1\right) \cdot \log y}{\color{blue}{1 + x}} + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                  13. lower-+.f6485.0

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

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

                  \[\leadsto \color{blue}{\frac{\log y \cdot \left({x}^{2} - 1\right)}{1 + x} - t} \]
                6. Step-by-step derivation
                  1. lower--.f64N/A

                    \[\leadsto \color{blue}{\frac{\log y \cdot \left({x}^{2} - 1\right)}{1 + x} - t} \]
                  2. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{\log y \cdot \left({x}^{2} - 1\right)}{1 + x}} - t \]
                  3. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\left({x}^{2} - 1\right) \cdot \log y}}{1 + x} - t \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{\color{blue}{\left({x}^{2} - 1\right) \cdot \log y}}{1 + x} - t \]
                  5. lower--.f64N/A

                    \[\leadsto \frac{\color{blue}{\left({x}^{2} - 1\right)} \cdot \log y}{1 + x} - t \]
                  6. unpow2N/A

                    \[\leadsto \frac{\left(\color{blue}{x \cdot x} - 1\right) \cdot \log y}{1 + x} - t \]
                  7. lower-*.f64N/A

                    \[\leadsto \frac{\left(\color{blue}{x \cdot x} - 1\right) \cdot \log y}{1 + x} - t \]
                  8. lower-log.f64N/A

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

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

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

                  \[\leadsto -1 \cdot \log y - \color{blue}{t} \]
                9. Step-by-step derivation
                  1. Applied rewrites80.2%

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

                  if 2.39999999999999991e-37 < x < 1.5000000000000001e58

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

                    \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right)} - t \]
                    2. remove-double-negN/A

                      \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot \left(x - 1\right)\right)\right)\right)\right)} + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                    3. distribute-lft-neg-outN/A

                      \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(x - 1\right)}\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                    4. log-recN/A

                      \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)} \cdot \left(x - 1\right)\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                    5. mul-1-negN/A

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

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

                    \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
                  7. Step-by-step derivation
                    1. Applied rewrites71.0%

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

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

                  Alternative 8: 89.5% accurate, 1.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z - 1 \leq 10^{+269}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x - 1, y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= (- z 1.0) 1e+269)
                     (- (fma (log y) (- x 1.0) y) t)
                     (- (* (* (- (* -0.5 y) 1.0) z) y) t)))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z - 1.0) <= 1e+269) {
                  		tmp = fma(log(y), (x - 1.0), y) - t;
                  	} else {
                  		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (Float64(z - 1.0) <= 1e+269)
                  		tmp = Float64(fma(log(y), Float64(x - 1.0), y) - t);
                  	else
                  		tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t);
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[N[(z - 1.0), $MachinePrecision], 1e+269], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision] + y), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z - 1 \leq 10^{+269}:\\
                  \;\;\;\;\mathsf{fma}\left(\log y, x - 1, y\right) - t\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (-.f64 z #s(literal 1 binary64)) < 1e269

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

                      \[\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. associate--l+N/A

                        \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                      2. associate-*r*N/A

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

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot \left(z - 1\right) + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                      4. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)} \]
                      5. lower-neg.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{-y}, z - 1, \log y \cdot \left(x - 1\right) - t\right) \]
                      6. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z - 1}, \log y \cdot \left(x - 1\right) - t\right) \]
                      7. *-rgt-identityN/A

                        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right) - \color{blue}{t \cdot 1}\right) \]
                      8. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right)} - t \]
                        2. remove-double-negN/A

                          \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot \left(x - 1\right)\right)\right)\right)\right)} + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                        3. distribute-lft-neg-outN/A

                          \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(x - 1\right)}\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                        4. log-recN/A

                          \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)} \cdot \left(x - 1\right)\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                        5. mul-1-negN/A

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

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

                        \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
                      7. Step-by-step derivation
                        1. Applied rewrites78.2%

                          \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot \color{blue}{y} - t \]
                      8. Recombined 2 regimes into one program.
                      9. Add Preprocessing

                      Alternative 9: 89.4% accurate, 1.9× speedup?

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

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

                          \[\leadsto \color{blue}{\log y \cdot \left(x - 1\right)} - t \]
                        4. Step-by-step derivation
                          1. remove-double-negN/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y\right)\right)\right)\right)} \cdot \left(x - 1\right) - t \]
                          2. log-recN/A

                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot \left(x - 1\right) - t \]
                          3. mul-1-negN/A

                            \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} \cdot \left(x - 1\right) - t \]
                          4. distribute-rgt-out--N/A

                            \[\leadsto \color{blue}{\left(x \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right)} - t \]
                          5. mul-1-negN/A

                            \[\leadsto \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
                          6. log-recN/A

                            \[\leadsto \left(x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
                          7. remove-double-negN/A

                            \[\leadsto \left(x \cdot \color{blue}{\log y} - 1 \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
                          8. fp-cancel-sub-sign-invN/A

                            \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(1\right)\right) \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right)} - t \]
                          9. metadata-evalN/A

                            \[\leadsto \left(x \cdot \log y + \color{blue}{-1} \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)\right) - t \]
                          10. mul-1-negN/A

                            \[\leadsto \left(x \cdot \log y + -1 \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)}\right) - t \]
                          11. log-recN/A

                            \[\leadsto \left(x \cdot \log y + -1 \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right)\right) - t \]
                          12. remove-double-negN/A

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

                            \[\leadsto \color{blue}{\left(-1 \cdot \log y + x \cdot \log y\right)} - t \]
                          14. distribute-rgt-outN/A

                            \[\leadsto \color{blue}{\log y \cdot \left(-1 + x\right)} - t \]
                          15. remove-double-negN/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y\right)\right)\right)\right)} \cdot \left(-1 + x\right) - t \]
                          16. log-recN/A

                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot \left(-1 + x\right) - t \]
                          17. mul-1-negN/A

                            \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} \cdot \left(-1 + x\right) - t \]
                          18. *-commutativeN/A

                            \[\leadsto \color{blue}{\left(-1 + x\right) \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} - t \]
                          19. lower-*.f64N/A

                            \[\leadsto \color{blue}{\left(-1 + x\right) \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right)} - t \]
                          20. lower-+.f64N/A

                            \[\leadsto \color{blue}{\left(-1 + x\right)} \cdot \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) - t \]
                          21. mul-1-negN/A

                            \[\leadsto \left(-1 + x\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} - t \]
                          22. log-recN/A

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

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

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

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

                          \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right)} - t \]
                          2. remove-double-negN/A

                            \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot \left(x - 1\right)\right)\right)\right)\right)} + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                          3. distribute-lft-neg-outN/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(x - 1\right)}\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                          4. log-recN/A

                            \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)} \cdot \left(x - 1\right)\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                          5. mul-1-negN/A

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

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

                          \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
                        7. Step-by-step derivation
                          1. Applied rewrites78.2%

                            \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot \color{blue}{y} - t \]
                        8. Recombined 2 regimes into one program.
                        9. Add Preprocessing

                        Alternative 10: 99.1% accurate, 1.9× speedup?

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

                          \[\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. associate--l+N/A

                            \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                          2. associate-*r*N/A

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

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot \left(z - 1\right) + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                          4. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)} \]
                          5. lower-neg.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{-y}, z - 1, \log y \cdot \left(x - 1\right) - t\right) \]
                          6. lower--.f64N/A

                            \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z - 1}, \log y \cdot \left(x - 1\right) - t\right) \]
                          7. *-rgt-identityN/A

                            \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right) - \color{blue}{t \cdot 1}\right) \]
                          8. fp-cancel-sub-sign-invN/A

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

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

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

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

                          Alternative 11: 67.2% accurate, 1.9× speedup?

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

                            1. Initial program 96.6%

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

                              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)\right)}\right) - t \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
                              2. lower-*.f64N/A

                                \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right) \cdot y\right)}\right) - t \]
                              3. lower--.f64N/A

                                \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\color{blue}{\left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)} \cdot y\right)\right) - t \]
                              4. *-commutativeN/A

                                \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
                              5. lower-*.f64N/A

                                \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y} - 1\right) \cdot y\right)\right) - t \]
                              6. lower--.f64N/A

                                \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(\color{blue}{\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right)} \cdot y - 1\right) \cdot y\right)\right) - t \]
                              7. lower-*.f6499.6

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - x, \left(x - 1\right) \cdot \frac{\log y}{1 - x}, \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y - 1\right) \cdot y\right) \cdot \left(z - 1\right) - t\right)} \]
                            7. Taylor expanded in x around inf

                              \[\leadsto \color{blue}{x \cdot \log y} \]
                            8. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              2. lower-*.f64N/A

                                \[\leadsto \color{blue}{\log y \cdot x} \]
                              3. lower-log.f6477.4

                                \[\leadsto \color{blue}{\log y} \cdot x \]
                            9. Applied rewrites77.4%

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

                            if -2.4e23 < x < 1.5000000000000001e58

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

                              \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right)} - t \]
                              2. remove-double-negN/A

                                \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot \left(x - 1\right)\right)\right)\right)\right)} + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                              3. distribute-lft-neg-outN/A

                                \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(x - 1\right)}\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                              4. log-recN/A

                                \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)} \cdot \left(x - 1\right)\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                              5. mul-1-negN/A

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

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

                              \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
                            7. Step-by-step derivation
                              1. Applied rewrites59.1%

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

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

                            Alternative 12: 46.3% accurate, 10.3× speedup?

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

                              \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) + \log y \cdot \left(x - 1\right)\right)} - t \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right)} - t \]
                              2. remove-double-negN/A

                                \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot \left(x - 1\right)\right)\right)\right)\right)} + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                              3. distribute-lft-neg-outN/A

                                \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(x - 1\right)}\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                              4. log-recN/A

                                \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)} \cdot \left(x - 1\right)\right)\right) + y \cdot \left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right)\right) - t \]
                              5. mul-1-negN/A

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

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

                              \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
                            7. Step-by-step derivation
                              1. Applied rewrites41.6%

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

                              Alternative 13: 42.7% accurate, 10.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+44} \lor \neg \left(t \leq 1.52 \cdot 10^{+29}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (if (or (<= t -1e+44) (not (<= t 1.52e+29))) (- t) (fma (- y) z y)))
                              double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if ((t <= -1e+44) || !(t <= 1.52e+29)) {
                              		tmp = -t;
                              	} else {
                              		tmp = fma(-y, z, y);
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t)
                              	tmp = 0.0
                              	if ((t <= -1e+44) || !(t <= 1.52e+29))
                              		tmp = Float64(-t);
                              	else
                              		tmp = fma(Float64(-y), z, y);
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1e+44], N[Not[LessEqual[t, 1.52e+29]], $MachinePrecision]], (-t), N[((-y) * z + y), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;t \leq -1 \cdot 10^{+44} \lor \neg \left(t \leq 1.52 \cdot 10^{+29}\right):\\
                              \;\;\;\;-t\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if t < -1.0000000000000001e44 or 1.52e29 < t

                                1. Initial program 97.7%

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

                                  \[\leadsto \color{blue}{-1 \cdot t} \]
                                4. Step-by-step derivation
                                  1. mul-1-negN/A

                                    \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
                                  2. lower-neg.f6469.1

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

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

                                if -1.0000000000000001e44 < t < 1.52e29

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

                                  \[\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. associate--l+N/A

                                    \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                                  2. associate-*r*N/A

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

                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot \left(z - 1\right) + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                                  4. lower-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)} \]
                                  5. lower-neg.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{-y}, z - 1, \log y \cdot \left(x - 1\right) - t\right) \]
                                  6. lower--.f64N/A

                                    \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z - 1}, \log y \cdot \left(x - 1\right) - t\right) \]
                                  7. *-rgt-identityN/A

                                    \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right) - \color{blue}{t \cdot 1}\right) \]
                                  8. fp-cancel-sub-sign-invN/A

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

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

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

                                    \[\leadsto \left(-y\right) \cdot \color{blue}{\left(z - 1\right)} \]
                                  2. Taylor expanded in z around 0

                                    \[\leadsto y + -1 \cdot \color{blue}{\left(y \cdot z\right)} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites18.1%

                                      \[\leadsto \mathsf{fma}\left(-y, z, y\right) \]
                                  4. Recombined 2 regimes into one program.
                                  5. Final simplification40.0%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+44} \lor \neg \left(t \leq 1.52 \cdot 10^{+29}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\ \end{array} \]
                                  6. Add Preprocessing

                                  Alternative 14: 42.4% accurate, 11.3× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+44} \lor \neg \left(t \leq 1.52 \cdot 10^{+29}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\left(-y\right) \cdot z\\ \end{array} \end{array} \]
                                  (FPCore (x y z t)
                                   :precision binary64
                                   (if (or (<= t -1e+44) (not (<= t 1.52e+29))) (- t) (* (- y) z)))
                                  double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if ((t <= -1e+44) || !(t <= 1.52e+29)) {
                                  		tmp = -t;
                                  	} else {
                                  		tmp = -y * 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 <= (-1d+44)) .or. (.not. (t <= 1.52d+29))) then
                                          tmp = -t
                                      else
                                          tmp = -y * z
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if ((t <= -1e+44) || !(t <= 1.52e+29)) {
                                  		tmp = -t;
                                  	} else {
                                  		tmp = -y * z;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t):
                                  	tmp = 0
                                  	if (t <= -1e+44) or not (t <= 1.52e+29):
                                  		tmp = -t
                                  	else:
                                  		tmp = -y * z
                                  	return tmp
                                  
                                  function code(x, y, z, t)
                                  	tmp = 0.0
                                  	if ((t <= -1e+44) || !(t <= 1.52e+29))
                                  		tmp = Float64(-t);
                                  	else
                                  		tmp = Float64(Float64(-y) * z);
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t)
                                  	tmp = 0.0;
                                  	if ((t <= -1e+44) || ~((t <= 1.52e+29)))
                                  		tmp = -t;
                                  	else
                                  		tmp = -y * z;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1e+44], N[Not[LessEqual[t, 1.52e+29]], $MachinePrecision]], (-t), N[((-y) * z), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;t \leq -1 \cdot 10^{+44} \lor \neg \left(t \leq 1.52 \cdot 10^{+29}\right):\\
                                  \;\;\;\;-t\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(-y\right) \cdot z\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if t < -1.0000000000000001e44 or 1.52e29 < t

                                    1. Initial program 97.7%

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

                                      \[\leadsto \color{blue}{-1 \cdot t} \]
                                    4. Step-by-step derivation
                                      1. mul-1-negN/A

                                        \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
                                      2. lower-neg.f6469.1

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

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

                                    if -1.0000000000000001e44 < t < 1.52e29

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

                                      \[\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. associate--l+N/A

                                        \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                                      2. associate-*r*N/A

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

                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} \cdot \left(z - 1\right) + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                                      4. lower-fma.f64N/A

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), z - 1, \log y \cdot \left(x - 1\right) - t\right)} \]
                                      5. lower-neg.f64N/A

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{-y}, z - 1, \log y \cdot \left(x - 1\right) - t\right) \]
                                      6. lower--.f64N/A

                                        \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z - 1}, \log y \cdot \left(x - 1\right) - t\right) \]
                                      7. *-rgt-identityN/A

                                        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right) - \color{blue}{t \cdot 1}\right) \]
                                      8. fp-cancel-sub-sign-invN/A

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

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

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

                                        \[\leadsto \left(-y\right) \cdot \color{blue}{z} \]
                                    8. Recombined 2 regimes into one program.
                                    9. Final simplification39.7%

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

                                    Alternative 15: 36.1% accurate, 75.3× 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 89.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 t around inf

                                      \[\leadsto \color{blue}{-1 \cdot t} \]
                                    4. Step-by-step derivation
                                      1. mul-1-negN/A

                                        \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
                                      2. lower-neg.f6432.0

                                        \[\leadsto \color{blue}{-t} \]
                                    5. Applied rewrites32.0%

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

                                    Reproduce

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