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

Percentage Accurate: 89.3% → 99.6%
Time: 21.3s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 89.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, y \cdot \frac{-1}{4} + \color{blue}{\frac{-1}{3}}, \frac{-1}{2}\right), -1\right)\right)\right) - t \]
    11. accelerator-lowering-fma.f6499.8

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right)\right)}\right) - t \]
  6. Step-by-step derivation
    1. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-1 + x, \log y, \left(-1 + z\right) \cdot \left(y \cdot \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, y \cdot \frac{-1}{4} + \frac{-1}{3}, \frac{-1}{2}\right)}, -1\right)\right)\right) - t \]
    15. accelerator-lowering-fma.f6499.8

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

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

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

Alternative 2: 86.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+15}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+46}:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < -4.99999999999999979e27 or 5.0000000000000002e46 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t)

    1. Initial program 92.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. *-lowering-*.f64N/A

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

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

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

    if -4.99999999999999979e27 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 1e15

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \log y \cdot \left(x + \color{blue}{-1}\right) \]
      5. +-lowering-+.f6476.4

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

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

    if 1e15 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 5.0000000000000002e46

    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
      12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
      23. distribute-neg-fracN/A

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
      26. /-lowering-/.f6451.3

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(-0.5 + \color{blue}{\frac{-1}{y}}\right)\right) - t \]
    8. Simplified51.3%

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

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

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

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

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

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

        \[\leadsto 0 - \left(y \cdot \left(z + \color{blue}{-1}\right) + t\right) \]
      6. distribute-lft-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - -1 \cdot y\right) - \left(y \cdot z + t\right)} \]
      15. neg-sub0N/A

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

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

        \[\leadsto \color{blue}{y} - \left(y \cdot z + t\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \color{blue}{y - \left(y \cdot z + t\right)} \]
      19. accelerator-lowering-fma.f6480.7

        \[\leadsto y - \color{blue}{\mathsf{fma}\left(y, z, t\right)} \]
    11. Simplified80.7%

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

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

Alternative 3: 76.9% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;-1 + x \leq -2 \cdot 10^{+121}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;-1 + x \leq -1.000000000010413:\\ \;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\ \mathbf{elif}\;-1 + x \leq -0.99:\\ \;\;\;\;0 - \left(\log y + t\right)\\ \mathbf{elif}\;-1 + x \leq 10^{+63}:\\ \;\;\;\;z \cdot \left(y \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= (+ -1.0 x) -2e+121)
     t_1
     (if (<= (+ -1.0 x) -1.000000000010413)
       (- y (fma y z t))
       (if (<= (+ -1.0 x) -0.99)
         (- 0.0 (+ (log y) t))
         (if (<= (+ -1.0 x) 1e+63)
           (- (* z (* y (fma y -0.5 -1.0))) t)
           t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double tmp;
	if ((-1.0 + x) <= -2e+121) {
		tmp = t_1;
	} else if ((-1.0 + x) <= -1.000000000010413) {
		tmp = y - fma(y, z, t);
	} else if ((-1.0 + x) <= -0.99) {
		tmp = 0.0 - (log(y) + t);
	} else if ((-1.0 + x) <= 1e+63) {
		tmp = (z * (y * fma(y, -0.5, -1.0))) - t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (Float64(-1.0 + x) <= -2e+121)
		tmp = t_1;
	elseif (Float64(-1.0 + x) <= -1.000000000010413)
		tmp = Float64(y - fma(y, z, t));
	elseif (Float64(-1.0 + x) <= -0.99)
		tmp = Float64(0.0 - Float64(log(y) + t));
	elseif (Float64(-1.0 + x) <= 1e+63)
		tmp = Float64(Float64(z * Float64(y * fma(y, -0.5, -1.0))) - 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[(-1.0 + x), $MachinePrecision], -2e+121], t$95$1, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.000000000010413], N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.99], N[(0.0 - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 1e+63], N[(N[(z * N[(y * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;-1 + x \leq -1.000000000010413:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\

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

\mathbf{elif}\;-1 + x \leq 10^{+63}:\\
\;\;\;\;z \cdot \left(y \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\

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


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

    1. Initial program 93.7%

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

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

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

        \[\leadsto \color{blue}{\log y \cdot x} \]
      3. log-lowering-log.f6474.0

        \[\leadsto \color{blue}{\log y} \cdot x \]
    5. Simplified74.0%

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

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

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
      12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
      23. distribute-neg-fracN/A

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
      26. /-lowering-/.f6438.4

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

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

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

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

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

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

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

        \[\leadsto 0 - \left(y \cdot \left(z + \color{blue}{-1}\right) + t\right) \]
      6. distribute-lft-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - -1 \cdot y\right) - \left(y \cdot z + t\right)} \]
      15. neg-sub0N/A

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

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

        \[\leadsto \color{blue}{y} - \left(y \cdot z + t\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \color{blue}{y - \left(y \cdot z + t\right)} \]
      19. accelerator-lowering-fma.f6462.5

        \[\leadsto y - \color{blue}{\mathsf{fma}\left(y, z, t\right)} \]
    11. Simplified62.5%

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

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

    1. Initial program 86.1%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y - t} \]
    7. Step-by-step derivation
      1. sub-negN/A

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

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\log y + t\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\log y + t\right)}\right) \]
      6. log-lowering-log.f6484.6

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

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

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

    1. Initial program 60.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(y \cdot \left(y \cdot \frac{-1}{2} + \color{blue}{-1}\right)\right) - t \]
      9. accelerator-lowering-fma.f6464.3

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

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

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

Alternative 4: 99.5% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.4% accurate, 1.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.4% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;-1 + x \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\left(y - \mathsf{fma}\left(y, z, t\right)\right) - \log y\\

\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\


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

    1. Initial program 91.3%

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

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

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

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

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

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

    1. Initial program 82.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. +-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. --lowering--.f64N/A

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

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

        \[\leadsto \log y \cdot \color{blue}{\left(-1 + x\right)} - \left(y \cdot \left(z - 1\right) + t\right) \]
      12. accelerator-lowering-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. +-lowering-+.f6499.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0 - -1 \cdot y\right) - \left(y \cdot z + t\right)\right)} - \log y \]
      15. neg-sub0N/A

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

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

        \[\leadsto \left(\color{blue}{y} - \left(y \cdot z + t\right)\right) - \log y \]
      18. --lowering--.f64N/A

        \[\leadsto \color{blue}{\left(y - \left(y \cdot z + t\right)\right)} - \log y \]
      19. accelerator-lowering-fma.f64N/A

        \[\leadsto \left(y - \color{blue}{\mathsf{fma}\left(y, z, t\right)}\right) - \log y \]
      20. log-lowering-log.f6498.1

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

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

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

    1. Initial program 88.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 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. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
      3. log-lowering-log.f6487.4

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

      \[\leadsto \color{blue}{\log y \cdot x} - t \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.6%

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

Alternative 7: 90.0% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := y - \mathsf{fma}\left(y, z, t\right)\\
\mathbf{if}\;-1 + z \leq -1 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z #s(literal 1 binary64)) < -9.99999999999999989e203 or 1.00000000000000006e279 < (-.f64 z #s(literal 1 binary64))

    1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
      12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
      23. distribute-neg-fracN/A

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
      26. /-lowering-/.f6411.6

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

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

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

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

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

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

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

        \[\leadsto 0 - \left(y \cdot \left(z + \color{blue}{-1}\right) + t\right) \]
      6. distribute-lft-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - -1 \cdot y\right) - \left(y \cdot z + t\right)} \]
      15. neg-sub0N/A

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

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

        \[\leadsto \color{blue}{y} - \left(y \cdot z + t\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \color{blue}{y - \left(y \cdot z + t\right)} \]
      19. accelerator-lowering-fma.f6488.2

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

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

    if -9.99999999999999989e203 < (-.f64 z #s(literal 1 binary64)) < 1.00000000000000006e279

    1. Initial program 93.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. *-lowering-*.f64N/A

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

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

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

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

Alternative 8: 94.7% accurate, 1.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, 0 - t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.9000000000000002e46

    1. Initial program 96.7%

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

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
      3. log-lowering-log.f6496.7

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

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

    if -2.9000000000000002e46 < t < 1.25e8

    1. Initial program 78.9%

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

      \[\leadsto \color{blue}{\left(-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. --lowering--.f64N/A

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

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

        \[\leadsto \log y \cdot \color{blue}{\left(-1 + x\right)} - \left(y \cdot \left(z - 1\right) + t\right) \]
      12. accelerator-lowering-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. +-lowering-+.f6499.4

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

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

      \[\leadsto \log y \cdot \left(-1 + x\right) - \color{blue}{y \cdot z} \]
    7. Step-by-step derivation
      1. *-lowering-*.f6497.1

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

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

    if 1.25e8 < t

    1. Initial program 96.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{0 - t}\right) \]
      5. --lowering--.f6495.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, 0 - t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.7%

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

Alternative 9: 61.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;-1 + z \leq -1 \cdot 10^{+146}:\\ \;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\ \mathbf{elif}\;-1 + z \leq 4 \cdot 10^{+143}:\\ \;\;\;\;0 - \left(\log y + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right) \cdot \left(y \cdot z\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (+ -1.0 z) -1e+146)
   (- y (fma y z t))
   (if (<= (+ -1.0 z) 4e+143)
     (- 0.0 (+ (log y) t))
     (-
      (* (fma y (fma y (fma y -0.25 -0.3333333333333333) -0.5) -1.0) (* y z))
      t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((-1.0 + z) <= -1e+146) {
		tmp = y - fma(y, z, t);
	} else if ((-1.0 + z) <= 4e+143) {
		tmp = 0.0 - (log(y) + t);
	} else {
		tmp = (fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0) * (y * z)) - t;
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(-1.0 + z) <= -1e+146)
		tmp = Float64(y - fma(y, z, t));
	elseif (Float64(-1.0 + z) <= 4e+143)
		tmp = Float64(0.0 - Float64(log(y) + t));
	else
		tmp = Float64(Float64(fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0) * Float64(y * z)) - t);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + z), $MachinePrecision], -1e+146], N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + z), $MachinePrecision], 4e+143], N[(0.0 - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(y * N[(y * -0.25 + -0.3333333333333333), $MachinePrecision] + -0.5), $MachinePrecision] + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;-1 + z \leq -1 \cdot 10^{+146}:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\

\mathbf{elif}\;-1 + z \leq 4 \cdot 10^{+143}:\\
\;\;\;\;0 - \left(\log y + t\right)\\

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


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

    1. Initial program 43.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
      12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
      23. distribute-neg-fracN/A

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
      26. /-lowering-/.f6416.3

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(-0.5 + \color{blue}{\frac{-1}{y}}\right)\right) - t \]
    8. Simplified16.3%

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

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

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

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

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

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

        \[\leadsto 0 - \left(y \cdot \left(z + \color{blue}{-1}\right) + t\right) \]
      6. distribute-lft-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - -1 \cdot y\right) - \left(y \cdot z + t\right)} \]
      15. neg-sub0N/A

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

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

        \[\leadsto \color{blue}{y} - \left(y \cdot z + t\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \color{blue}{y - \left(y \cdot z + t\right)} \]
      19. accelerator-lowering-fma.f6474.9

        \[\leadsto y - \color{blue}{\mathsf{fma}\left(y, z, t\right)} \]
    11. Simplified74.9%

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

    if -9.99999999999999934e145 < (-.f64 z #s(literal 1 binary64)) < 4.0000000000000001e143

    1. Initial program 97.8%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y - t} \]
    7. Step-by-step derivation
      1. sub-negN/A

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

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\log y + t\right)\right)} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\log y + t\right)}\right) \]
      6. log-lowering-log.f6463.0

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

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

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

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) + \color{blue}{-1}\right) \cdot \left(y \cdot z\right) - t \]
      8. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(y, y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) + \color{blue}{\frac{-1}{2}}, -1\right) \cdot \left(y \cdot z\right) - t \]
      11. accelerator-lowering-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(y, y \cdot \frac{-1}{4} + \color{blue}{\frac{-1}{3}}, \frac{-1}{2}\right), -1\right) \cdot \left(y \cdot z\right) - t \]
      15. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, \frac{-1}{4}, \frac{-1}{3}\right)}, \frac{-1}{2}\right), -1\right) \cdot \left(y \cdot z\right) - t \]
      16. *-lowering-*.f6472.8

        \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right) \cdot \color{blue}{\left(y \cdot z\right)} - t \]
    8. Simplified72.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;-1 + z \leq -1 \cdot 10^{+146}:\\ \;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\ \mathbf{elif}\;-1 + z \leq 4 \cdot 10^{+143}:\\ \;\;\;\;0 - \left(\log y + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right) \cdot \left(y \cdot z\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 78.5% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{+15}:\\ \;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\ \mathbf{elif}\;t \leq 1250:\\ \;\;\;\;\log y \cdot \left(-1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot \left(\frac{\mathsf{fma}\left(y, 0.5, 1\right)}{z} - \mathsf{fma}\left(y, 0.5, 1\right)\right)\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -1.15e+15)
   (- y (fma y z t))
   (if (<= t 1250.0)
     (* (log y) (+ -1.0 x))
     (- (* z (* y (- (/ (fma y 0.5 1.0) z) (fma y 0.5 1.0)))) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.15e+15) {
		tmp = y - fma(y, z, t);
	} else if (t <= 1250.0) {
		tmp = log(y) * (-1.0 + x);
	} else {
		tmp = (z * (y * ((fma(y, 0.5, 1.0) / z) - fma(y, 0.5, 1.0)))) - t;
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1.15e+15)
		tmp = Float64(y - fma(y, z, t));
	elseif (t <= 1250.0)
		tmp = Float64(log(y) * Float64(-1.0 + x));
	else
		tmp = Float64(Float64(z * Float64(y * Float64(Float64(fma(y, 0.5, 1.0) / z) - fma(y, 0.5, 1.0)))) - t);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.15e+15], N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1250.0], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * N[(N[(N[(y * 0.5 + 1.0), $MachinePrecision] / z), $MachinePrecision] - N[(y * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+15}:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\

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

\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(\frac{\mathsf{fma}\left(y, 0.5, 1\right)}{z} - \mathsf{fma}\left(y, 0.5, 1\right)\right)\right) - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.15e15

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
      12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
      23. distribute-neg-fracN/A

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
      26. /-lowering-/.f6463.4

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

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

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

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

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

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

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

        \[\leadsto 0 - \left(y \cdot \left(z + \color{blue}{-1}\right) + t\right) \]
      6. distribute-lft-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - -1 \cdot y\right) - \left(y \cdot z + t\right)} \]
      15. neg-sub0N/A

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

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

        \[\leadsto \color{blue}{y} - \left(y \cdot z + t\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \color{blue}{y - \left(y \cdot z + t\right)} \]
      19. accelerator-lowering-fma.f6483.4

        \[\leadsto y - \color{blue}{\mathsf{fma}\left(y, z, t\right)} \]
    11. Simplified83.4%

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

    if -1.15e15 < t < 1250

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \log y \cdot \left(x + \color{blue}{-1}\right) \]
      5. +-lowering-+.f6480.1

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

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

    if 1250 < t

    1. Initial program 95.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(\color{blue}{\left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) \cdot y} + \log y \cdot \left(x - 1\right)\right) - t \]
      2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
      12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
      23. distribute-neg-fracN/A

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

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
      26. /-lowering-/.f6449.2

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

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

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left({y}^{2} \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right) + \frac{{y}^{2} \cdot \left(\frac{1}{2} + \frac{1}{y}\right)}{z}\right)} - t \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(y \cdot \left(y \cdot \frac{\frac{1}{2} + \frac{1}{y}}{z}\right) - \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)}\right) - t \]
      10. distribute-lft-out--N/A

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

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

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

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

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

Alternative 11: 99.1% accurate, 1.9× speedup?

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

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

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

    \[\leadsto \color{blue}{\left(-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. --lowering--.f64N/A

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

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

      \[\leadsto \log y \cdot \color{blue}{\left(-1 + x\right)} - \left(y \cdot \left(z - 1\right) + t\right) \]
    12. accelerator-lowering-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. +-lowering-+.f6499.5

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

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

Alternative 12: 46.7% accurate, 5.7× speedup?

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

\\
z \cdot \left(y \cdot \left(\frac{\mathsf{fma}\left(y, 0.5, 1\right)}{z} - \mathsf{fma}\left(y, 0.5, 1\right)\right)\right) - t
\end{array}
Derivation
  1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
  7. Step-by-step derivation
    1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
    12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
    23. distribute-neg-fracN/A

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

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

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
    26. /-lowering-/.f6432.4

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

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

    \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \left({y}^{2} \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right) + \frac{{y}^{2} \cdot \left(\frac{1}{2} + \frac{1}{y}\right)}{z}\right)} - t \]
  10. Step-by-step derivation
    1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(y \cdot \left(y \cdot \frac{\frac{1}{2} + \frac{1}{y}}{z}\right) - \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)}\right) - t \]
    10. distribute-lft-out--N/A

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

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

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

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

Alternative 13: 46.6% accurate, 6.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
  7. Step-by-step derivation
    1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
    12. distribute-neg-fracN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
    23. distribute-neg-fracN/A

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

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

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
    26. /-lowering-/.f6432.4

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

    \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(-0.5 + \frac{-1}{y}\right)\right)} - t \]
  9. Step-by-step derivation
    1. associate-*r*N/A

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{-1}{2} + \frac{-1}{y}\right) \cdot \left(y \cdot \color{blue}{\left(y \cdot \left(-1 + z\right)\right)}\right) - t \]
    9. +-lowering-+.f6448.7

      \[\leadsto \left(-0.5 + \frac{-1}{y}\right) \cdot \left(y \cdot \left(y \cdot \color{blue}{\left(-1 + z\right)}\right)\right) - t \]
  10. Applied egg-rr48.7%

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

Alternative 14: 46.6% accurate, 7.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) + \color{blue}{-1}\right) \cdot \left(y \cdot z\right) - t \]
    8. accelerator-lowering-fma.f64N/A

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

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

      \[\leadsto \mathsf{fma}\left(y, y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) + \color{blue}{\frac{-1}{2}}, -1\right) \cdot \left(y \cdot z\right) - t \]
    11. accelerator-lowering-fma.f64N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(y, y \cdot \frac{-1}{4} + \color{blue}{\frac{-1}{3}}, \frac{-1}{2}\right), -1\right) \cdot \left(y \cdot z\right) - t \]
    15. accelerator-lowering-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, \frac{-1}{4}, \frac{-1}{3}\right)}, \frac{-1}{2}\right), -1\right) \cdot \left(y \cdot z\right) - t \]
    16. *-lowering-*.f6448.7

      \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right) \cdot \color{blue}{\left(y \cdot z\right)} - t \]
  8. Simplified48.7%

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

Alternative 15: 43.4% accurate, 10.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+21}:\\
\;\;\;\;0 - t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.6e21 or 1.25e7 < t

    1. Initial program 95.9%

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

      \[\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. neg-sub0N/A

        \[\leadsto \color{blue}{0 - t} \]
      3. --lowering--.f6476.5

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

      \[\leadsto \color{blue}{0 - t} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
      2. neg-lowering-neg.f6476.5

        \[\leadsto \color{blue}{-t} \]
    7. Applied egg-rr76.5%

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

    if -2.6e21 < t < 1.25e7

    1. Initial program 79.1%

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

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

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

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

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

        \[\leadsto \log y \cdot \color{blue}{\left(-1 + x\right)} - \left(y \cdot \left(z - 1\right) + t\right) \]
      12. accelerator-lowering-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. +-lowering-+.f6499.4

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\color{blue}{\left(0 - z\right)} + 1\right) \]
      6. associate-+l-N/A

        \[\leadsto y \cdot \color{blue}{\left(0 - \left(z - 1\right)\right)} \]
      7. neg-sub0N/A

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(z - 1\right)\right)\right)} \]
      11. neg-sub0N/A

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

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

        \[\leadsto y \cdot \left(0 - \left(z + \color{blue}{-1}\right)\right) \]
      14. +-commutativeN/A

        \[\leadsto y \cdot \left(0 - \color{blue}{\left(-1 + z\right)}\right) \]
      15. associate--r+N/A

        \[\leadsto y \cdot \color{blue}{\left(\left(0 - -1\right) - z\right)} \]
      16. metadata-evalN/A

        \[\leadsto y \cdot \left(\color{blue}{1} - z\right) \]
      17. --lowering--.f6423.2

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

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

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

Alternative 16: 46.5% accurate, 11.3× speedup?

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

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

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

    \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \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(\color{blue}{\left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) \cdot y} + \log y \cdot \left(x - 1\right)\right) - t \]
    2. associate-*r*N/A

      \[\leadsto \left(\left(-1 \cdot \left(z - 1\right) + \color{blue}{\left(\frac{-1}{2} \cdot y\right) \cdot \left(z - 1\right)}\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    3. distribute-rgt-outN/A

      \[\leadsto \left(\color{blue}{\left(\left(z - 1\right) \cdot \left(-1 + \frac{-1}{2} \cdot y\right)\right)} \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    4. +-commutativeN/A

      \[\leadsto \left(\left(\left(z - 1\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot y + -1\right)}\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    5. metadata-evalN/A

      \[\leadsto \left(\left(\left(z - 1\right) \cdot \left(\frac{-1}{2} \cdot y + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    6. sub-negN/A

      \[\leadsto \left(\left(\left(z - 1\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot y - 1\right)}\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    7. associate-*l*N/A

      \[\leadsto \left(\color{blue}{\left(z - 1\right) \cdot \left(\left(\frac{-1}{2} \cdot y - 1\right) \cdot y\right)} + \log y \cdot \left(x - 1\right)\right) - t \]
    8. *-commutativeN/A

      \[\leadsto \left(\left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} + \log y \cdot \left(x - 1\right)\right) - t \]
    9. accelerator-lowering-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right)} - t \]
    10. sub-negN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z + \left(\mathsf{neg}\left(1\right)\right)}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(z + \color{blue}{-1}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{-1 + z}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{-1 + z}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, \color{blue}{y \cdot \left(\frac{-1}{2} \cdot y - 1\right)}, \log y \cdot \left(x - 1\right)\right) - t \]
    15. sub-negN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \color{blue}{\left(\frac{-1}{2} \cdot y + \left(\mathsf{neg}\left(1\right)\right)\right)}, \log y \cdot \left(x - 1\right)\right) - t \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \left(\color{blue}{y \cdot \frac{-1}{2}} + \left(\mathsf{neg}\left(1\right)\right)\right), \log y \cdot \left(x - 1\right)\right) - t \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \left(y \cdot \frac{-1}{2} + \color{blue}{-1}\right), \log y \cdot \left(x - 1\right)\right) - t \]
    18. accelerator-lowering-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \color{blue}{\mathsf{fma}\left(y, \frac{-1}{2}, -1\right)}, \log y \cdot \left(x - 1\right)\right) - t \]
    19. *-lowering-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, \frac{-1}{2}, -1\right), \color{blue}{\log y \cdot \left(x - 1\right)}\right) - t \]
    20. log-lowering-log.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, \frac{-1}{2}, -1\right), \color{blue}{\log y} \cdot \left(x - 1\right)\right) - t \]
    21. sub-negN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, \frac{-1}{2}, -1\right), \log y \cdot \color{blue}{\left(x + \left(\mathsf{neg}\left(1\right)\right)\right)}\right) - t \]
  5. Simplified99.7%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, -0.5, -1\right), \log y \cdot \left(-1 + x\right)\right)} - t \]
  6. Taylor expanded in z around inf

    \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right) \cdot y} - t \]
    2. associate-*l*N/A

      \[\leadsto \color{blue}{z \cdot \left(\left(\frac{-1}{2} \cdot y - 1\right) \cdot y\right)} - t \]
    3. *-commutativeN/A

      \[\leadsto z \cdot \color{blue}{\left(y \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
    4. *-lowering-*.f64N/A

      \[\leadsto \color{blue}{z \cdot \left(y \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
    5. *-lowering-*.f64N/A

      \[\leadsto z \cdot \color{blue}{\left(y \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} - t \]
    6. sub-negN/A

      \[\leadsto z \cdot \left(y \cdot \color{blue}{\left(\frac{-1}{2} \cdot y + \left(\mathsf{neg}\left(1\right)\right)\right)}\right) - t \]
    7. *-commutativeN/A

      \[\leadsto z \cdot \left(y \cdot \left(\color{blue}{y \cdot \frac{-1}{2}} + \left(\mathsf{neg}\left(1\right)\right)\right)\right) - t \]
    8. metadata-evalN/A

      \[\leadsto z \cdot \left(y \cdot \left(y \cdot \frac{-1}{2} + \color{blue}{-1}\right)\right) - t \]
    9. accelerator-lowering-fma.f6448.6

      \[\leadsto z \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(y, -0.5, -1\right)}\right) - t \]
  8. Simplified48.6%

    \[\leadsto \color{blue}{z \cdot \left(y \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right)} - t \]
  9. Add Preprocessing

Alternative 17: 46.4% accurate, 22.6× speedup?

\[\begin{array}{l} \\ y - \mathsf{fma}\left(y, z, t\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (- y (fma y z t)))
double code(double x, double y, double z, double t) {
	return y - fma(y, z, t);
}
function code(x, y, z, t)
	return Float64(y - fma(y, z, t))
end
code[x_, y_, z_, t_] := N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y - \mathsf{fma}\left(y, z, t\right)
\end{array}
Derivation
  1. Initial program 86.5%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Add Preprocessing
  3. Taylor expanded in y around 0

    \[\leadsto \color{blue}{\left(y \cdot \left(-1 \cdot \left(z - 1\right) + \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(\color{blue}{\left(-1 \cdot \left(z - 1\right) + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) \cdot y} + \log y \cdot \left(x - 1\right)\right) - t \]
    2. associate-*r*N/A

      \[\leadsto \left(\left(-1 \cdot \left(z - 1\right) + \color{blue}{\left(\frac{-1}{2} \cdot y\right) \cdot \left(z - 1\right)}\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    3. distribute-rgt-outN/A

      \[\leadsto \left(\color{blue}{\left(\left(z - 1\right) \cdot \left(-1 + \frac{-1}{2} \cdot y\right)\right)} \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    4. +-commutativeN/A

      \[\leadsto \left(\left(\left(z - 1\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot y + -1\right)}\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    5. metadata-evalN/A

      \[\leadsto \left(\left(\left(z - 1\right) \cdot \left(\frac{-1}{2} \cdot y + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    6. sub-negN/A

      \[\leadsto \left(\left(\left(z - 1\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot y - 1\right)}\right) \cdot y + \log y \cdot \left(x - 1\right)\right) - t \]
    7. associate-*l*N/A

      \[\leadsto \left(\color{blue}{\left(z - 1\right) \cdot \left(\left(\frac{-1}{2} \cdot y - 1\right) \cdot y\right)} + \log y \cdot \left(x - 1\right)\right) - t \]
    8. *-commutativeN/A

      \[\leadsto \left(\left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} + \log y \cdot \left(x - 1\right)\right) - t \]
    9. accelerator-lowering-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right)} - t \]
    10. sub-negN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z + \left(\mathsf{neg}\left(1\right)\right)}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(z + \color{blue}{-1}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{-1 + z}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{-1 + z}, y \cdot \left(\frac{-1}{2} \cdot y - 1\right), \log y \cdot \left(x - 1\right)\right) - t \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, \color{blue}{y \cdot \left(\frac{-1}{2} \cdot y - 1\right)}, \log y \cdot \left(x - 1\right)\right) - t \]
    15. sub-negN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \color{blue}{\left(\frac{-1}{2} \cdot y + \left(\mathsf{neg}\left(1\right)\right)\right)}, \log y \cdot \left(x - 1\right)\right) - t \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \left(\color{blue}{y \cdot \frac{-1}{2}} + \left(\mathsf{neg}\left(1\right)\right)\right), \log y \cdot \left(x - 1\right)\right) - t \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \left(y \cdot \frac{-1}{2} + \color{blue}{-1}\right), \log y \cdot \left(x - 1\right)\right) - t \]
    18. accelerator-lowering-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \color{blue}{\mathsf{fma}\left(y, \frac{-1}{2}, -1\right)}, \log y \cdot \left(x - 1\right)\right) - t \]
    19. *-lowering-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, \frac{-1}{2}, -1\right), \color{blue}{\log y \cdot \left(x - 1\right)}\right) - t \]
    20. log-lowering-log.f64N/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, \frac{-1}{2}, -1\right), \color{blue}{\log y} \cdot \left(x - 1\right)\right) - t \]
    21. sub-negN/A

      \[\leadsto \mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, \frac{-1}{2}, -1\right), \log y \cdot \color{blue}{\left(x + \left(\mathsf{neg}\left(1\right)\right)\right)}\right) - t \]
  5. Simplified99.7%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, -0.5, -1\right), \log y \cdot \left(-1 + x\right)\right)} - t \]
  6. Taylor expanded in y around inf

    \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
  7. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \color{blue}{{y}^{2} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right)} - t \]
    2. unpow2N/A

      \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right) - t \]
    3. *-lowering-*.f64N/A

      \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(-1 \cdot \frac{z - 1}{y} + \frac{-1}{2} \cdot \left(z - 1\right)\right) - t \]
    4. +-commutativeN/A

      \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(z - 1\right) + -1 \cdot \frac{z - 1}{y}\right)} - t \]
    5. *-commutativeN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\color{blue}{\left(z - 1\right) \cdot \frac{-1}{2}} + -1 \cdot \frac{z - 1}{y}\right) - t \]
    6. associate-*r/N/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \frac{-1}{2} + \color{blue}{\frac{-1 \cdot \left(z - 1\right)}{y}}\right) - t \]
    7. *-commutativeN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \frac{-1}{2} + \frac{\color{blue}{\left(z - 1\right) \cdot -1}}{y}\right) - t \]
    8. associate-/l*N/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \frac{-1}{2} + \color{blue}{\left(z - 1\right) \cdot \frac{-1}{y}}\right) - t \]
    9. distribute-lft-outN/A

      \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(\left(z - 1\right) \cdot \left(\frac{-1}{2} + \frac{-1}{y}\right)\right)} - t \]
    10. metadata-evalN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \frac{-1}{y}\right)\right) - t \]
    11. metadata-evalN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \frac{\color{blue}{\mathsf{neg}\left(1\right)}}{y}\right)\right) - t \]
    12. distribute-neg-fracN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{y}\right)\right)}\right)\right) - t \]
    13. distribute-neg-inN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} + \frac{1}{y}\right)\right)\right)}\right) - t \]
    14. mul-1-negN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z - 1\right) \cdot \color{blue}{\left(-1 \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)}\right) - t \]
    15. *-lowering-*.f64N/A

      \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(\left(z - 1\right) \cdot \left(-1 \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)\right)} - t \]
    16. sub-negN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\color{blue}{\left(z + \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot \left(-1 \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)\right) - t \]
    17. metadata-evalN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(z + \color{blue}{-1}\right) \cdot \left(-1 \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)\right) - t \]
    18. +-commutativeN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)\right) - t \]
    19. +-lowering-+.f64N/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot \left(\frac{1}{2} + \frac{1}{y}\right)\right)\right) - t \]
    20. mul-1-negN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} + \frac{1}{y}\right)\right)\right)}\right) - t \]
    21. distribute-neg-inN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)}\right) - t \]
    22. metadata-evalN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(\frac{1}{y}\right)\right)\right)\right) - t \]
    23. distribute-neg-fracN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\frac{-1}{2} + \color{blue}{\frac{\mathsf{neg}\left(1\right)}{y}}\right)\right) - t \]
    24. metadata-evalN/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(\frac{-1}{2} + \frac{\color{blue}{-1}}{y}\right)\right) - t \]
    25. +-lowering-+.f64N/A

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \color{blue}{\left(\frac{-1}{2} + \frac{-1}{y}\right)}\right) - t \]
    26. /-lowering-/.f6432.4

      \[\leadsto \left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(-0.5 + \color{blue}{\frac{-1}{y}}\right)\right) - t \]
  8. Simplified32.4%

    \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot \left(-0.5 + \frac{-1}{y}\right)\right)} - t \]
  9. Taylor expanded in y around 0

    \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(z - 1\right)\right) - t} \]
  10. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y \cdot \left(z - 1\right)\right)\right)} - t \]
    2. neg-sub0N/A

      \[\leadsto \color{blue}{\left(0 - y \cdot \left(z - 1\right)\right)} - t \]
    3. associate--r+N/A

      \[\leadsto \color{blue}{0 - \left(y \cdot \left(z - 1\right) + t\right)} \]
    4. sub-negN/A

      \[\leadsto 0 - \left(y \cdot \color{blue}{\left(z + \left(\mathsf{neg}\left(1\right)\right)\right)} + t\right) \]
    5. metadata-evalN/A

      \[\leadsto 0 - \left(y \cdot \left(z + \color{blue}{-1}\right) + t\right) \]
    6. distribute-lft-inN/A

      \[\leadsto 0 - \left(\color{blue}{\left(y \cdot z + y \cdot -1\right)} + t\right) \]
    7. *-commutativeN/A

      \[\leadsto 0 - \left(\left(y \cdot z + \color{blue}{-1 \cdot y}\right) + t\right) \]
    8. associate-+l+N/A

      \[\leadsto 0 - \color{blue}{\left(y \cdot z + \left(-1 \cdot y + t\right)\right)} \]
    9. +-commutativeN/A

      \[\leadsto 0 - \left(y \cdot z + \color{blue}{\left(t + -1 \cdot y\right)}\right) \]
    10. +-commutativeN/A

      \[\leadsto 0 - \color{blue}{\left(\left(t + -1 \cdot y\right) + y \cdot z\right)} \]
    11. associate-+r+N/A

      \[\leadsto 0 - \color{blue}{\left(t + \left(-1 \cdot y + y \cdot z\right)\right)} \]
    12. +-commutativeN/A

      \[\leadsto 0 - \color{blue}{\left(\left(-1 \cdot y + y \cdot z\right) + t\right)} \]
    13. associate-+l+N/A

      \[\leadsto 0 - \color{blue}{\left(-1 \cdot y + \left(y \cdot z + t\right)\right)} \]
    14. associate--r+N/A

      \[\leadsto \color{blue}{\left(0 - -1 \cdot y\right) - \left(y \cdot z + t\right)} \]
    15. neg-sub0N/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot y\right)\right)} - \left(y \cdot z + t\right) \]
    16. mul-1-negN/A

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)\right) - \left(y \cdot z + t\right) \]
    17. remove-double-negN/A

      \[\leadsto \color{blue}{y} - \left(y \cdot z + t\right) \]
    18. --lowering--.f64N/A

      \[\leadsto \color{blue}{y - \left(y \cdot z + t\right)} \]
    19. accelerator-lowering-fma.f6448.6

      \[\leadsto y - \color{blue}{\mathsf{fma}\left(y, z, t\right)} \]
  11. Simplified48.6%

    \[\leadsto \color{blue}{y - \mathsf{fma}\left(y, z, t\right)} \]
  12. Add Preprocessing

Alternative 18: 36.0% accurate, 56.5× speedup?

\[\begin{array}{l} \\ 0 - t \end{array} \]
(FPCore (x y z t) :precision binary64 (- 0.0 t))
double code(double x, double y, double z, double t) {
	return 0.0 - t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = 0.0d0 - t
end function
public static double code(double x, double y, double z, double t) {
	return 0.0 - t;
}
def code(x, y, z, t):
	return 0.0 - t
function code(x, y, z, t)
	return Float64(0.0 - t)
end
function tmp = code(x, y, z, t)
	tmp = 0.0 - t;
end
code[x_, y_, z_, t_] := N[(0.0 - t), $MachinePrecision]
\begin{array}{l}

\\
0 - t
\end{array}
Derivation
  1. Initial program 86.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 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. neg-sub0N/A

      \[\leadsto \color{blue}{0 - t} \]
    3. --lowering--.f6435.4

      \[\leadsto \color{blue}{0 - t} \]
  5. Simplified35.4%

    \[\leadsto \color{blue}{0 - t} \]
  6. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
    2. neg-lowering-neg.f6435.4

      \[\leadsto \color{blue}{-t} \]
  7. Applied egg-rr35.4%

    \[\leadsto \color{blue}{-t} \]
  8. Final simplification35.4%

    \[\leadsto 0 - t \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024195 
(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))