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

Percentage Accurate: 89.2% → 99.6%
Time: 18.5s
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: 89.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.6× speedup?

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

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

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

    \[\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. lower-fma.f64N/A

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

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

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

Alternative 2: 94.3% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x + -1 \leq -5 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x + -1 \leq 2 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - z, -\log 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)) < -5e21 or 2e53 < (-.f64 x #s(literal 1 binary64))

    1. Initial program 95.3%

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

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

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

    if -5e21 < (-.f64 x #s(literal 1 binary64)) < 2e53

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 94.3% accurate, 1.7× speedup?

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

      1. Initial program 95.3%

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

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

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

      if -5e21 < (-.f64 x #s(literal 1 binary64)) < 2e53

      1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 99.5% accurate, 1.7× speedup?

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

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

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

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

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

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

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

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

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

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

        Alternative 5: 99.5% accurate, 1.7× speedup?

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

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

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

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

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

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

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

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

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

        Alternative 6: 87.1% accurate, 1.8× speedup?

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

          1. Initial program 93.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 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.f6493.4

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

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

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

          1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

            \[\leadsto -1 \cdot \color{blue}{\log y} - t \]
          7. Step-by-step derivation
            1. Applied rewrites81.5%

              \[\leadsto \left(-\log y\right) - t \]
          8. Recombined 2 regimes into one program.
          9. Final simplification87.3%

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

          Alternative 7: 75.3% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x + -1 \leq -4 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x + -1 \leq 2 \cdot 10^{+61}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* x (log y))))
             (if (<= (+ x -1.0) -4e+58)
               t_1
               (if (<= (+ x -1.0) 2e+61) (- (- (log y)) t) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = x * log(y);
          	double tmp;
          	if ((x + -1.0) <= -4e+58) {
          		tmp = t_1;
          	} else if ((x + -1.0) <= 2e+61) {
          		tmp = -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) :: tmp
              t_1 = x * log(y)
              if ((x + (-1.0d0)) <= (-4d+58)) then
                  tmp = t_1
              else if ((x + (-1.0d0)) <= 2d+61) then
                  tmp = -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 = x * Math.log(y);
          	double tmp;
          	if ((x + -1.0) <= -4e+58) {
          		tmp = t_1;
          	} else if ((x + -1.0) <= 2e+61) {
          		tmp = -Math.log(y) - t;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	t_1 = x * math.log(y)
          	tmp = 0
          	if (x + -1.0) <= -4e+58:
          		tmp = t_1
          	elif (x + -1.0) <= 2e+61:
          		tmp = -math.log(y) - t
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t)
          	t_1 = Float64(x * log(y))
          	tmp = 0.0
          	if (Float64(x + -1.0) <= -4e+58)
          		tmp = t_1;
          	elseif (Float64(x + -1.0) <= 2e+61)
          		tmp = Float64(Float64(-log(y)) - t);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	t_1 = x * log(y);
          	tmp = 0.0;
          	if ((x + -1.0) <= -4e+58)
          		tmp = t_1;
          	elseif ((x + -1.0) <= 2e+61)
          		tmp = -log(y) - t;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + -1.0), $MachinePrecision], -4e+58], t$95$1, If[LessEqual[N[(x + -1.0), $MachinePrecision], 2e+61], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := x \cdot \log y\\
          \mathbf{if}\;x + -1 \leq -4 \cdot 10^{+58}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x + -1 \leq 2 \cdot 10^{+61}:\\
          \;\;\;\;\left(-\log 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)) < -3.99999999999999978e58 or 1.9999999999999999e61 < (-.f64 x #s(literal 1 binary64))

            1. Initial program 94.8%

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

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

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

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

            if -3.99999999999999978e58 < (-.f64 x #s(literal 1 binary64)) < 1.9999999999999999e61

            1. Initial program 83.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}{\log y \cdot \left(x - 1\right)} - t \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

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

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

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

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

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

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

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

              \[\leadsto -1 \cdot \color{blue}{\log y} - t \]
            7. Step-by-step derivation
              1. Applied rewrites79.5%

                \[\leadsto \left(-\log y\right) - t \]
            8. Recombined 2 regimes into one program.
            9. Final simplification79.9%

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

            Alternative 8: 66.1% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x + -1 \leq -4 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x + -1 \leq 2 \cdot 10^{+61}:\\ \;\;\;\;\mathsf{fma}\left(y, -z, y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (* x (log y))))
               (if (<= (+ x -1.0) -4e+58)
                 t_1
                 (if (<= (+ x -1.0) 2e+61) (- (fma y (- z) y) t) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = x * log(y);
            	double tmp;
            	if ((x + -1.0) <= -4e+58) {
            		tmp = t_1;
            	} else if ((x + -1.0) <= 2e+61) {
            		tmp = fma(y, -z, y) - t;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t)
            	t_1 = Float64(x * log(y))
            	tmp = 0.0
            	if (Float64(x + -1.0) <= -4e+58)
            		tmp = t_1;
            	elseif (Float64(x + -1.0) <= 2e+61)
            		tmp = Float64(fma(y, Float64(-z), y) - t);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + -1.0), $MachinePrecision], -4e+58], t$95$1, If[LessEqual[N[(x + -1.0), $MachinePrecision], 2e+61], N[(N[(y * (-z) + y), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := x \cdot \log y\\
            \mathbf{if}\;x + -1 \leq -4 \cdot 10^{+58}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;x + -1 \leq 2 \cdot 10^{+61}:\\
            \;\;\;\;\mathsf{fma}\left(y, -z, 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)) < -3.99999999999999978e58 or 1.9999999999999999e61 < (-.f64 x #s(literal 1 binary64))

              1. Initial program 94.8%

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

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

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

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

              if -3.99999999999999978e58 < (-.f64 x #s(literal 1 binary64)) < 1.9999999999999999e61

              1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 88.7% accurate, 1.9× speedup?

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

                1. Initial program 55.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 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.f6467.4

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

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

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

                1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 10: 88.6% accurate, 1.9× speedup?

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

                  1. Initial program 55.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 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.f6467.4

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

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

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

                  1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

                Alternative 11: 99.2% accurate, 1.9× speedup?

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

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

                  \[\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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 12: 43.2% accurate, 10.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{+19}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 34000000000:\\ \;\;\;\;\mathsf{fma}\left(y, -z, y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (if (<= t -3.8e+19) (- t) (if (<= t 34000000000.0) (fma y (- z) y) (- t))))
                double code(double x, double y, double z, double t) {
                	double tmp;
                	if (t <= -3.8e+19) {
                		tmp = -t;
                	} else if (t <= 34000000000.0) {
                		tmp = fma(y, -z, y);
                	} else {
                		tmp = -t;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t)
                	tmp = 0.0
                	if (t <= -3.8e+19)
                		tmp = Float64(-t);
                	elseif (t <= 34000000000.0)
                		tmp = fma(y, Float64(-z), y);
                	else
                		tmp = Float64(-t);
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_] := If[LessEqual[t, -3.8e+19], (-t), If[LessEqual[t, 34000000000.0], N[(y * (-z) + y), $MachinePrecision], (-t)]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;t \leq -3.8 \cdot 10^{+19}:\\
                \;\;\;\;-t\\
                
                \mathbf{elif}\;t \leq 34000000000:\\
                \;\;\;\;\mathsf{fma}\left(y, -z, y\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;-t\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if t < -3.8e19 or 3.4e10 < t

                  1. Initial program 95.3%

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

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

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

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

                  if -3.8e19 < t < 3.4e10

                  1. Initial program 82.0%

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

                    \[\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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 13: 42.9% accurate, 11.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{+19}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 34000000000:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= t -3.8e+19) (- t) (if (<= t 34000000000.0) (* z (- y)) (- t))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (t <= -3.8e+19) {
                  		tmp = -t;
                  	} else if (t <= 34000000000.0) {
                  		tmp = 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 <= (-3.8d+19)) then
                          tmp = -t
                      else if (t <= 34000000000.0d0) then
                          tmp = 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 <= -3.8e+19) {
                  		tmp = -t;
                  	} else if (t <= 34000000000.0) {
                  		tmp = z * -y;
                  	} else {
                  		tmp = -t;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if t <= -3.8e+19:
                  		tmp = -t
                  	elif t <= 34000000000.0:
                  		tmp = z * -y
                  	else:
                  		tmp = -t
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (t <= -3.8e+19)
                  		tmp = Float64(-t);
                  	elseif (t <= 34000000000.0)
                  		tmp = Float64(z * Float64(-y));
                  	else
                  		tmp = Float64(-t);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if (t <= -3.8e+19)
                  		tmp = -t;
                  	elseif (t <= 34000000000.0)
                  		tmp = z * -y;
                  	else
                  		tmp = -t;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[t, -3.8e+19], (-t), If[LessEqual[t, 34000000000.0], N[(z * (-y)), $MachinePrecision], (-t)]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;t \leq -3.8 \cdot 10^{+19}:\\
                  \;\;\;\;-t\\
                  
                  \mathbf{elif}\;t \leq 34000000000:\\
                  \;\;\;\;z \cdot \left(-y\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;-t\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if t < -3.8e19 or 3.4e10 < t

                    1. Initial program 95.3%

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

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

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

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

                    if -3.8e19 < t < 3.4e10

                    1. Initial program 82.0%

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

                      \[\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. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{+19}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 34000000000:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
                    13. Add Preprocessing

                    Alternative 14: 46.3% accurate, 18.8× speedup?

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

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

                      \[\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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 15: 46.1% accurate, 20.5× speedup?

                      \[\begin{array}{l} \\ z \cdot \left(-y\right) - 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(z * Float64(-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}
                      
                      \\
                      z \cdot \left(-y\right) - t
                      \end{array}
                      
                      Derivation
                      1. Initial program 88.0%

                        \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                      2. Add Preprocessing
                      3. Taylor expanded in 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.f6446.5

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

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

                        \[\leadsto \left(-1 \cdot y\right) \cdot z - t \]
                      7. Step-by-step derivation
                        1. Applied rewrites46.2%

                          \[\leadsto \left(-y\right) \cdot z - t \]
                        2. Final simplification46.2%

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

                        Alternative 16: 35.8% 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 88.0%

                          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                        2. Add Preprocessing
                        3. Taylor expanded in 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.f6434.6

                            \[\leadsto \color{blue}{-t} \]
                        5. Applied rewrites34.6%

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

                        Reproduce

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