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

Percentage Accurate: 88.6% → 99.5%
Time: 12.6s
Alternatives: 16
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 16 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: 88.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 1.6× speedup?

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

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

      \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
    2. *-commutativeN/A

      \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
    3. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
  5. Applied rewrites99.7%

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

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

Alternative 2: 73.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+124}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 350:\\ \;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\ \mathbf{elif}\;t\_2 \leq 4000000000000:\\ \;\;\;\;\left(y - \log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (log y) x))
        (t_2 (- (* (log (- 1.0 y)) (- z 1.0)) (* (- 1.0 x) (log y)))))
   (if (<= t_2 -2e+124)
     t_1
     (if (<= t_2 350.0)
       (- (fma (- z) y y) t)
       (if (<= t_2 4000000000000.0) (- (- y (log y)) t) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = log(y) * x;
	double t_2 = (log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y));
	double tmp;
	if (t_2 <= -2e+124) {
		tmp = t_1;
	} else if (t_2 <= 350.0) {
		tmp = fma(-z, y, y) - t;
	} else if (t_2 <= 4000000000000.0) {
		tmp = (y - log(y)) - t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(log(y) * x)
	t_2 = Float64(Float64(log(Float64(1.0 - y)) * Float64(z - 1.0)) - Float64(Float64(1.0 - x) * log(y)))
	tmp = 0.0
	if (t_2 <= -2e+124)
		tmp = t_1;
	elseif (t_2 <= 350.0)
		tmp = Float64(fma(Float64(-z), y, y) - t);
	elseif (t_2 <= 4000000000000.0)
		tmp = Float64(Float64(y - log(y)) - t);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+124], t$95$1, If[LessEqual[t$95$2, 350.0], N[(N[((-z) * y + y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 4000000000000.0], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 350:\\
\;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\

\mathbf{elif}\;t\_2 \leq 4000000000000:\\
\;\;\;\;\left(y - \log y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < -1.9999999999999999e124 or 4e12 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y))))

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

        \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    5. Applied rewrites99.2%

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    7. 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.f6479.9

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

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

    if -1.9999999999999999e124 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 350

    1. Initial program 71.4%

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

      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
      13. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

      if 350 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 4e12

      1. Initial program 89.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
        13. distribute-rgt-inN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, y\right)\right) - t \]
        17. lower-neg.f64100.0

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

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

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

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

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

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

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

        Alternative 3: 73.5% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+124}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 350:\\ \;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\ \mathbf{elif}\;t\_2 \leq 4000000000000:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* (log y) x))
                (t_2 (- (* (log (- 1.0 y)) (- z 1.0)) (* (- 1.0 x) (log y)))))
           (if (<= t_2 -2e+124)
             t_1
             (if (<= t_2 350.0)
               (- (fma (- z) y y) t)
               (if (<= t_2 4000000000000.0) (- (- (log y)) t) t_1)))))
        double code(double x, double y, double z, double t) {
        	double t_1 = log(y) * x;
        	double t_2 = (log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y));
        	double tmp;
        	if (t_2 <= -2e+124) {
        		tmp = t_1;
        	} else if (t_2 <= 350.0) {
        		tmp = fma(-z, y, y) - t;
        	} else if (t_2 <= 4000000000000.0) {
        		tmp = -log(y) - t;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(log(y) * x)
        	t_2 = Float64(Float64(log(Float64(1.0 - y)) * Float64(z - 1.0)) - Float64(Float64(1.0 - x) * log(y)))
        	tmp = 0.0
        	if (t_2 <= -2e+124)
        		tmp = t_1;
        	elseif (t_2 <= 350.0)
        		tmp = Float64(fma(Float64(-z), y, y) - t);
        	elseif (t_2 <= 4000000000000.0)
        		tmp = Float64(Float64(-log(y)) - t);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+124], t$95$1, If[LessEqual[t$95$2, 350.0], N[(N[((-z) * y + y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 4000000000000.0], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \log y \cdot x\\
        t_2 := \log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\\
        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+124}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_2 \leq 350:\\
        \;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\
        
        \mathbf{elif}\;t\_2 \leq 4000000000000:\\
        \;\;\;\;\left(-\log y\right) - t\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < -1.9999999999999999e124 or 4e12 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y))))

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

              \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
            3. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
          5. Applied rewrites99.2%

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

            \[\leadsto \color{blue}{x \cdot \log y} \]
          7. 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.f6479.9

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

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

          if -1.9999999999999999e124 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 350

          1. Initial program 71.4%

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

            \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
            13. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

            if 350 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 4e12

            1. Initial program 89.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
              13. distribute-rgt-inN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, y\right)\right) - t \]
              17. lower-neg.f64100.0

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

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

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

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

                \[\leadsto -1 \cdot \log y - t \]
              3. Step-by-step derivation
                1. Applied rewrites87.1%

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

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

              Alternative 4: 86.4% accurate, 0.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x - t\\ t_2 := \left(\log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\right) - t\\ \mathbf{if}\;t\_2 \leq -10000000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2000:\\ \;\;\;\;\left(y - \log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (- (* (log y) x) t))
                      (t_2 (- (- (* (log (- 1.0 y)) (- z 1.0)) (* (- 1.0 x) (log y))) t)))
                 (if (<= t_2 -10000000000000.0)
                   t_1
                   (if (<= t_2 2000.0) (- (- y (log y)) t) t_1))))
              double code(double x, double y, double z, double t) {
              	double t_1 = (log(y) * x) - t;
              	double t_2 = ((log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y))) - t;
              	double tmp;
              	if (t_2 <= -10000000000000.0) {
              		tmp = t_1;
              	} else if (t_2 <= 2000.0) {
              		tmp = (y - log(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) :: t_2
                  real(8) :: tmp
                  t_1 = (log(y) * x) - t
                  t_2 = ((log((1.0d0 - y)) * (z - 1.0d0)) - ((1.0d0 - x) * log(y))) - t
                  if (t_2 <= (-10000000000000.0d0)) then
                      tmp = t_1
                  else if (t_2 <= 2000.0d0) then
                      tmp = (y - log(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) - t;
              	double t_2 = ((Math.log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * Math.log(y))) - t;
              	double tmp;
              	if (t_2 <= -10000000000000.0) {
              		tmp = t_1;
              	} else if (t_2 <= 2000.0) {
              		tmp = (y - Math.log(y)) - t;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = (math.log(y) * x) - t
              	t_2 = ((math.log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * math.log(y))) - t
              	tmp = 0
              	if t_2 <= -10000000000000.0:
              		tmp = t_1
              	elif t_2 <= 2000.0:
              		tmp = (y - math.log(y)) - t
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(Float64(log(y) * x) - t)
              	t_2 = Float64(Float64(Float64(log(Float64(1.0 - y)) * Float64(z - 1.0)) - Float64(Float64(1.0 - x) * log(y))) - t)
              	tmp = 0.0
              	if (t_2 <= -10000000000000.0)
              		tmp = t_1;
              	elseif (t_2 <= 2000.0)
              		tmp = Float64(Float64(y - log(y)) - t);
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = (log(y) * x) - t;
              	t_2 = ((log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y))) - t;
              	tmp = 0.0;
              	if (t_2 <= -10000000000000.0)
              		tmp = t_1;
              	elseif (t_2 <= 2000.0)
              		tmp = (y - log(y)) - t;
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$2, -10000000000000.0], t$95$1, If[LessEqual[t$95$2, 2000.0], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \log y \cdot x - t\\
              t_2 := \left(\log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\right) - t\\
              \mathbf{if}\;t\_2 \leq -10000000000000:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;t\_2 \leq 2000:\\
              \;\;\;\;\left(y - \log y\right) - t\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < -1e13 or 2e3 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t)

                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 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. lower-*.f64N/A

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

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

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

                if -1e13 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 2e3

                1. Initial program 72.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(-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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
                  13. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 5: 99.5% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

                  Alternative 6: 95.6% accurate, 1.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x - 1, \log y, -t\right)\\ \mathbf{if}\;x - 1 \leq -300000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x - 1 \leq -0.99999999999999:\\ \;\;\;\;\mathsf{fma}\left(1 - z, y, -\left(\log y + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (let* ((t_1 (fma (- x 1.0) (log y) (- t))))
                     (if (<= (- x 1.0) -300000000.0)
                       t_1
                       (if (<= (- x 1.0) -0.99999999999999)
                         (fma (- 1.0 z) y (- (+ (log y) t)))
                         t_1))))
                  double code(double x, double y, double z, double t) {
                  	double t_1 = fma((x - 1.0), log(y), -t);
                  	double tmp;
                  	if ((x - 1.0) <= -300000000.0) {
                  		tmp = t_1;
                  	} else if ((x - 1.0) <= -0.99999999999999) {
                  		tmp = fma((1.0 - z), y, -(log(y) + t));
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t)
                  	t_1 = fma(Float64(x - 1.0), log(y), Float64(-t))
                  	tmp = 0.0
                  	if (Float64(x - 1.0) <= -300000000.0)
                  		tmp = t_1;
                  	elseif (Float64(x - 1.0) <= -0.99999999999999)
                  		tmp = fma(Float64(1.0 - z), y, Float64(-Float64(log(y) + t)));
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]}, If[LessEqual[N[(x - 1.0), $MachinePrecision], -300000000.0], t$95$1, If[LessEqual[N[(x - 1.0), $MachinePrecision], -0.99999999999999], N[(N[(1.0 - z), $MachinePrecision] * y + (-N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision])), $MachinePrecision], t$95$1]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \mathsf{fma}\left(x - 1, \log y, -t\right)\\
                  \mathbf{if}\;x - 1 \leq -300000000:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;x - 1 \leq -0.99999999999999:\\
                  \;\;\;\;\mathsf{fma}\left(1 - z, y, -\left(\log y + t\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (-.f64 x #s(literal 1 binary64)) < -3e8 or -0.99999999999999001 < (-.f64 x #s(literal 1 binary64))

                    1. Initial program 91.4%

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \mathsf{neg}\left(t\right)\right) \]
                      6. lower-neg.f6491.2

                        \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-t}\right) \]
                    5. Applied rewrites91.2%

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

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

                    1. Initial program 78.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) + 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. associate--l+N/A

                        \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                      3. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
                    5. Applied rewrites99.8%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot \mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, \mathsf{fma}\left(-1, z, 1\right)\right), y, \mathsf{fma}\left(x - 1, \log y, -t\right)\right)} \]
                    6. 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} \]
                    7. 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. mul-1-negN/A

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(z + \color{blue}{-1}\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
                      9. distribute-lft-inN/A

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(1 - z, y, \log y \cdot \left(x + \color{blue}{-1}\right) + \left(\mathsf{neg}\left(t\right)\right)\right) \]
                      18. distribute-rgt-inN/A

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

                        \[\leadsto \mathsf{fma}\left(1 - z, y, \color{blue}{\left(-1 \cdot \log y + x \cdot \log y\right)} + \left(\mathsf{neg}\left(t\right)\right)\right) \]
                      20. distribute-rgt-outN/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(1 - z, y, -1 \cdot \log y - t\right) \]
                    10. Step-by-step derivation
                      1. Applied rewrites98.6%

                        \[\leadsto \mathsf{fma}\left(1 - z, y, -\left(\log y + t\right)\right) \]
                    11. Recombined 2 regimes into one program.
                    12. Add Preprocessing

                    Alternative 7: 99.4% accurate, 1.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(z - 1\right)} \cdot y, \frac{-1}{2} \cdot y - 1, \log y \cdot \left(x - 1\right)\right) - t \]
                      15. sub-negN/A

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

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

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

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

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

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

                    Alternative 8: 95.6% accurate, 1.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x - 1, \log y, -t\right)\\ \mathbf{if}\;x - 1 \leq -300000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x - 1 \leq -0.99999999999999:\\ \;\;\;\;\left(y - \mathsf{fma}\left(y, z, \log y\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (let* ((t_1 (fma (- x 1.0) (log y) (- t))))
                       (if (<= (- x 1.0) -300000000.0)
                         t_1
                         (if (<= (- x 1.0) -0.99999999999999) (- (- y (fma y z (log y))) t) t_1))))
                    double code(double x, double y, double z, double t) {
                    	double t_1 = fma((x - 1.0), log(y), -t);
                    	double tmp;
                    	if ((x - 1.0) <= -300000000.0) {
                    		tmp = t_1;
                    	} else if ((x - 1.0) <= -0.99999999999999) {
                    		tmp = (y - fma(y, z, log(y))) - t;
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t)
                    	t_1 = fma(Float64(x - 1.0), log(y), Float64(-t))
                    	tmp = 0.0
                    	if (Float64(x - 1.0) <= -300000000.0)
                    		tmp = t_1;
                    	elseif (Float64(x - 1.0) <= -0.99999999999999)
                    		tmp = Float64(Float64(y - fma(y, z, log(y))) - t);
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]}, If[LessEqual[N[(x - 1.0), $MachinePrecision], -300000000.0], t$95$1, If[LessEqual[N[(x - 1.0), $MachinePrecision], -0.99999999999999], N[(N[(y - N[(y * z + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \mathsf{fma}\left(x - 1, \log y, -t\right)\\
                    \mathbf{if}\;x - 1 \leq -300000000:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;x - 1 \leq -0.99999999999999:\\
                    \;\;\;\;\left(y - \mathsf{fma}\left(y, z, \log y\right)\right) - t\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (-.f64 x #s(literal 1 binary64)) < -3e8 or -0.99999999999999001 < (-.f64 x #s(literal 1 binary64))

                      1. Initial program 91.4%

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \mathsf{neg}\left(t\right)\right) \]
                        6. lower-neg.f6491.2

                          \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-t}\right) \]
                      5. Applied rewrites91.2%

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

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

                      1. Initial program 78.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
                        13. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(y - \color{blue}{\mathsf{fma}\left(y, z, \log y\right)}\right) - t \]
                        4. Recombined 2 regimes into one program.
                        5. Add Preprocessing

                        Alternative 9: 88.8% accurate, 1.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{log1p}\left(-y\right) \cdot z - t\\ \mathbf{if}\;z - 1 \leq -1 \cdot 10^{+247}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z - 1 \leq 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (let* ((t_1 (- (* (log1p (- y)) z) t)))
                           (if (<= (- z 1.0) -1e+247)
                             t_1
                             (if (<= (- z 1.0) 1e+154) (fma (- x 1.0) (log y) (- t)) t_1))))
                        double code(double x, double y, double z, double t) {
                        	double t_1 = (log1p(-y) * z) - t;
                        	double tmp;
                        	if ((z - 1.0) <= -1e+247) {
                        		tmp = t_1;
                        	} else if ((z - 1.0) <= 1e+154) {
                        		tmp = fma((x - 1.0), log(y), -t);
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z, t)
                        	t_1 = Float64(Float64(log1p(Float64(-y)) * z) - t)
                        	tmp = 0.0
                        	if (Float64(z - 1.0) <= -1e+247)
                        		tmp = t_1;
                        	elseif (Float64(z - 1.0) <= 1e+154)
                        		tmp = fma(Float64(x - 1.0), log(y), Float64(-t));
                        	else
                        		tmp = t_1;
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[1 + (-y)], $MachinePrecision] * z), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[N[(z - 1.0), $MachinePrecision], -1e+247], t$95$1, If[LessEqual[N[(z - 1.0), $MachinePrecision], 1e+154], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision], t$95$1]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \mathsf{log1p}\left(-y\right) \cdot z - t\\
                        \mathbf{if}\;z - 1 \leq -1 \cdot 10^{+247}:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;z - 1 \leq 10^{+154}:\\
                        \;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (-.f64 z #s(literal 1 binary64)) < -9.99999999999999952e246 or 1.00000000000000004e154 < (-.f64 z #s(literal 1 binary64))

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

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{neg}\left(y\right)\right)} \cdot z - t \]
                            5. lower-neg.f6478.8

                              \[\leadsto \mathsf{log1p}\left(\color{blue}{-y}\right) \cdot z - t \]
                          5. Applied rewrites78.8%

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

                          if -9.99999999999999952e246 < (-.f64 z #s(literal 1 binary64)) < 1.00000000000000004e154

                          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 y around 0

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \mathsf{neg}\left(t\right)\right) \]
                            6. lower-neg.f6495.2

                              \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-t}\right) \]
                          5. Applied rewrites95.2%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, -t\right)} \]
                        3. Recombined 2 regimes into one program.
                        4. Add Preprocessing

                        Alternative 10: 66.1% accurate, 1.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x - 1 \leq -5 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x - 1 \leq 2 \cdot 10^{+120}:\\ \;\;\;\;\mathsf{fma}\left(-z, y, y\right) - 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.0) -5e+20)
                             t_1
                             (if (<= (- x 1.0) 2e+120) (- (fma (- z) y 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.0) <= -5e+20) {
                        		tmp = t_1;
                        	} else if ((x - 1.0) <= 2e+120) {
                        		tmp = fma(-z, y, y) - t;
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z, t)
                        	t_1 = Float64(log(y) * x)
                        	tmp = 0.0
                        	if (Float64(x - 1.0) <= -5e+20)
                        		tmp = t_1;
                        	elseif (Float64(x - 1.0) <= 2e+120)
                        		tmp = Float64(fma(Float64(-z), y, y) - t);
                        	else
                        		tmp = t_1;
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x - 1.0), $MachinePrecision], -5e+20], t$95$1, If[LessEqual[N[(x - 1.0), $MachinePrecision], 2e+120], N[(N[((-z) * y + y), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \log y \cdot x\\
                        \mathbf{if}\;x - 1 \leq -5 \cdot 10^{+20}:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;x - 1 \leq 2 \cdot 10^{+120}:\\
                        \;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (-.f64 x #s(literal 1 binary64)) < -5e20 or 2e120 < (-.f64 x #s(literal 1 binary64))

                          1. Initial program 96.5%

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

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

                              \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                            2. *-commutativeN/A

                              \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                            3. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
                          5. Applied rewrites99.6%

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

                            \[\leadsto \color{blue}{x \cdot \log y} \]
                          7. 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.f6481.8

                              \[\leadsto \color{blue}{\log y} \cdot x \]
                          8. Applied rewrites81.8%

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

                          if -5e20 < (-.f64 x #s(literal 1 binary64)) < 2e120

                          1. Initial program 79.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(-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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
                            13. distribute-rgt-inN/A

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

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

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

                              \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, y\right)\right) - t \]
                            17. lower-neg.f6499.3

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

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

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

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

                          Alternative 11: 99.0% accurate, 1.9× speedup?

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

                              \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                            2. *-commutativeN/A

                              \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                            3. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
                          5. Applied rewrites99.7%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot \mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, \mathsf{fma}\left(-1, z, 1\right)\right), y, \mathsf{fma}\left(x - 1, \log y, -t\right)\right)} \]
                          6. 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} \]
                          7. 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. mul-1-negN/A

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(-1 \cdot \left(z + \color{blue}{-1}\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
                            9. distribute-lft-inN/A

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(1 - z, y, \log y \cdot \left(x + \color{blue}{-1}\right) + \left(\mathsf{neg}\left(t\right)\right)\right) \]
                            18. distribute-rgt-inN/A

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

                              \[\leadsto \mathsf{fma}\left(1 - z, y, \color{blue}{\left(-1 \cdot \log y + x \cdot \log y\right)} + \left(\mathsf{neg}\left(t\right)\right)\right) \]
                            20. distribute-rgt-outN/A

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

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

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

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

                          Alternative 12: 43.4% accurate, 10.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-11}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 62000000:\\ \;\;\;\;y - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                          (FPCore (x y z t)
                           :precision binary64
                           (if (<= t -1.05e-11) (- t) (if (<= t 62000000.0) (- y (* z y)) (- t))))
                          double code(double x, double y, double z, double t) {
                          	double tmp;
                          	if (t <= -1.05e-11) {
                          		tmp = -t;
                          	} else if (t <= 62000000.0) {
                          		tmp = y - (z * y);
                          	} else {
                          		tmp = -t;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, y, z, t)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8) :: tmp
                              if (t <= (-1.05d-11)) then
                                  tmp = -t
                              else if (t <= 62000000.0d0) then
                                  tmp = y - (z * y)
                              else
                                  tmp = -t
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t) {
                          	double tmp;
                          	if (t <= -1.05e-11) {
                          		tmp = -t;
                          	} else if (t <= 62000000.0) {
                          		tmp = y - (z * y);
                          	} else {
                          		tmp = -t;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t):
                          	tmp = 0
                          	if t <= -1.05e-11:
                          		tmp = -t
                          	elif t <= 62000000.0:
                          		tmp = y - (z * y)
                          	else:
                          		tmp = -t
                          	return tmp
                          
                          function code(x, y, z, t)
                          	tmp = 0.0
                          	if (t <= -1.05e-11)
                          		tmp = Float64(-t);
                          	elseif (t <= 62000000.0)
                          		tmp = Float64(y - Float64(z * y));
                          	else
                          		tmp = Float64(-t);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t)
                          	tmp = 0.0;
                          	if (t <= -1.05e-11)
                          		tmp = -t;
                          	elseif (t <= 62000000.0)
                          		tmp = y - (z * y);
                          	else
                          		tmp = -t;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_] := If[LessEqual[t, -1.05e-11], (-t), If[LessEqual[t, 62000000.0], N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision], (-t)]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;t \leq -1.05 \cdot 10^{-11}:\\
                          \;\;\;\;-t\\
                          
                          \mathbf{elif}\;t \leq 62000000:\\
                          \;\;\;\;y - z \cdot y\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;-t\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if t < -1.0499999999999999e-11 or 6.2e7 < t

                            1. Initial program 91.8%

                              \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                            2. 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.f6468.0

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

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

                            if -1.0499999999999999e-11 < t < 6.2e7

                            1. Initial program 78.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(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. associate--l+N/A

                                \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                              2. *-commutativeN/A

                                \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                              3. lower-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
                            5. Applied rewrites99.8%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot \mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, \mathsf{fma}\left(-1, z, 1\right)\right), y, \mathsf{fma}\left(x - 1, \log y, -t\right)\right)} \]
                            6. 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} \]
                            7. 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. mul-1-negN/A

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(-1 \cdot \left(z + \color{blue}{-1}\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
                              9. distribute-lft-inN/A

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(1 - z, y, \log y \cdot \left(x + \color{blue}{-1}\right) + \left(\mathsf{neg}\left(t\right)\right)\right) \]
                              18. distribute-rgt-inN/A

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

                                \[\leadsto \mathsf{fma}\left(1 - z, y, \color{blue}{\left(-1 \cdot \log y + x \cdot \log y\right)} + \left(\mathsf{neg}\left(t\right)\right)\right) \]
                              20. distribute-rgt-outN/A

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

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

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

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

                                \[\leadsto y - \color{blue}{y \cdot z} \]
                            11. Recombined 2 regimes into one program.
                            12. Final simplification44.6%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-11}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 62000000:\\ \;\;\;\;y - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
                            13. Add Preprocessing

                            Alternative 13: 43.1% accurate, 11.3× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-11}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 62000000:\\ \;\;\;\;\left(-y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                            (FPCore (x y z t)
                             :precision binary64
                             (if (<= t -1.05e-11) (- t) (if (<= t 62000000.0) (* (- y) z) (- t))))
                            double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (t <= -1.05e-11) {
                            		tmp = -t;
                            	} else if (t <= 62000000.0) {
                            		tmp = -y * z;
                            	} else {
                            		tmp = -t;
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(x, y, z, t)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8) :: tmp
                                if (t <= (-1.05d-11)) then
                                    tmp = -t
                                else if (t <= 62000000.0d0) then
                                    tmp = -y * z
                                else
                                    tmp = -t
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (t <= -1.05e-11) {
                            		tmp = -t;
                            	} else if (t <= 62000000.0) {
                            		tmp = -y * z;
                            	} else {
                            		tmp = -t;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t):
                            	tmp = 0
                            	if t <= -1.05e-11:
                            		tmp = -t
                            	elif t <= 62000000.0:
                            		tmp = -y * z
                            	else:
                            		tmp = -t
                            	return tmp
                            
                            function code(x, y, z, t)
                            	tmp = 0.0
                            	if (t <= -1.05e-11)
                            		tmp = Float64(-t);
                            	elseif (t <= 62000000.0)
                            		tmp = Float64(Float64(-y) * z);
                            	else
                            		tmp = Float64(-t);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t)
                            	tmp = 0.0;
                            	if (t <= -1.05e-11)
                            		tmp = -t;
                            	elseif (t <= 62000000.0)
                            		tmp = -y * z;
                            	else
                            		tmp = -t;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_] := If[LessEqual[t, -1.05e-11], (-t), If[LessEqual[t, 62000000.0], N[((-y) * z), $MachinePrecision], (-t)]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;t \leq -1.05 \cdot 10^{-11}:\\
                            \;\;\;\;-t\\
                            
                            \mathbf{elif}\;t \leq 62000000:\\
                            \;\;\;\;\left(-y\right) \cdot z\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;-t\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if t < -1.0499999999999999e-11 or 6.2e7 < t

                              1. Initial program 91.8%

                                \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                              2. 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.f6468.0

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

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

                              if -1.0499999999999999e-11 < t < 6.2e7

                              1. Initial program 78.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(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. associate--l+N/A

                                  \[\leadsto \color{blue}{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) + \left(\log y \cdot \left(x - 1\right) - t\right)} \]
                                2. *-commutativeN/A

                                  \[\leadsto \color{blue}{\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) \cdot y} + \left(\log y \cdot \left(x - 1\right) - t\right) \]
                                3. lower-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\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), y, \log y \cdot \left(x - 1\right) - t\right)} \]
                              5. Applied rewrites99.8%

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

                                \[\leadsto \color{blue}{z \cdot \log \left(1 - y\right)} \]
                              7. Step-by-step derivation
                                1. *-commutativeN/A

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

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

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

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

                                  \[\leadsto \color{blue}{\mathsf{log1p}\left(-1 \cdot y\right)} \cdot z \]
                                6. mul-1-negN/A

                                  \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{neg}\left(y\right)}\right) \cdot z \]
                                7. lower-neg.f6424.5

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

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

                                \[\leadsto \left(-1 \cdot y\right) \cdot z \]
                              10. Step-by-step derivation
                                1. Applied rewrites24.4%

                                  \[\leadsto \left(-y\right) \cdot z \]
                              11. Recombined 2 regimes into one program.
                              12. Add Preprocessing

                              Alternative 14: 46.3% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
                                13. distribute-rgt-inN/A

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

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

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

                                  \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, y\right)\right) - t \]
                                17. lower-neg.f6499.4

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

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

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

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

                                Alternative 15: 46.1% accurate, 20.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(x - 1, \log y, y \cdot \left(-1 \cdot z + \color{blue}{1}\right)\right) - t \]
                                  13. distribute-rgt-inN/A

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

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

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

                                    \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, y, y\right)\right) - t \]
                                  17. lower-neg.f6499.4

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

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

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

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

                                  Alternative 16: 35.3% 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 84.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 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.8

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

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

                                  Reproduce

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