Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B

Percentage Accurate: 85.2% → 99.5%
Time: 14.8s
Alternatives: 10
Speedup: 1.9×

Specification

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

\\
\left(x \cdot \log y + z \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 10 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: 85.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 1.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y - z \cdot y\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.79999999999999969e137 or 4.7999999999999996e174 < z

    1. Initial program 49.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\log y} - y \cdot z \]
      7. lower-*.f6485.5

        \[\leadsto x \cdot \log y - \color{blue}{y \cdot z} \]
    11. Simplified85.5%

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

    if -5.79999999999999969e137 < z < 4.7999999999999996e174

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.3% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 47.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z \cdot \color{blue}{\mathsf{fma}\left(y, \frac{-1}{2}, -1\right)}, \mathsf{neg}\left(t\right)\right) \]
      8. lower-neg.f6469.0

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

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

    if -1.3e168 < z < 2.2e169

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2e169 < z

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(y \cdot z + t\right)}\right) \]
      15. lower-fma.f6475.5

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

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

Alternative 4: 77.8% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.35e132 or 2.34999999999999986e58 < x

    1. Initial program 97.4%

      \[\left(x \cdot \log y + z \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. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\log y} \]
    5. Simplified86.3%

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

    if -1.35e132 < x < 2.34999999999999986e58

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(y \cdot z + t\right)}\right) \]
      15. lower-fma.f6478.4

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

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

Alternative 5: 99.2% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.2% accurate, 1.9× speedup?

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

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

    \[\left(x \cdot \log y + z \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 z\right) + x \cdot \log y\right) - t} \]
  4. Step-by-step derivation
    1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 46.6% accurate, 11.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -7 \cdot 10^{+137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+174}:\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- y))))
   (if (<= z -7e+137) t_1 (if (<= z 4.8e+174) (- t) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -y;
	double tmp;
	if (z <= -7e+137) {
		tmp = t_1;
	} else if (z <= 4.8e+174) {
		tmp = -t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -y
    if (z <= (-7d+137)) then
        tmp = t_1
    else if (z <= 4.8d+174) then
        tmp = -t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -y;
	double tmp;
	if (z <= -7e+137) {
		tmp = t_1;
	} else if (z <= 4.8e+174) {
		tmp = -t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -y
	tmp = 0
	if z <= -7e+137:
		tmp = t_1
	elif z <= 4.8e+174:
		tmp = -t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-y))
	tmp = 0.0
	if (z <= -7e+137)
		tmp = t_1;
	elseif (z <= 4.8e+174)
		tmp = Float64(-t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -y;
	tmp = 0.0;
	if (z <= -7e+137)
		tmp = t_1;
	elseif (z <= 4.8e+174)
		tmp = -t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-y)), $MachinePrecision]}, If[LessEqual[z, -7e+137], t$95$1, If[LessEqual[z, 4.8e+174], (-t), t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{+174}:\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.0000000000000002e137 or 4.7999999999999996e174 < z

    1. Initial program 49.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(y \cdot z\right)} \]
      3. lower-*.f6451.7

        \[\leadsto -\color{blue}{y \cdot z} \]
    11. Simplified51.7%

      \[\leadsto \color{blue}{-y \cdot z} \]

    if -7.0000000000000002e137 < z < 4.7999999999999996e174

    1. Initial program 97.3%

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.7%

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

Alternative 8: 58.5% accurate, 11.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, z \cdot \color{blue}{\mathsf{fma}\left(y, \frac{-1}{2}, -1\right)}, \mathsf{neg}\left(t\right)\right) \]
    8. lower-neg.f6456.4

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

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

Alternative 9: 58.2% accurate, 24.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{neg}\left(\color{blue}{\left(y \cdot z + t\right)}\right) \]
    15. lower-fma.f6456.3

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

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

Alternative 10: 43.7% accurate, 73.3× speedup?

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

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

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

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

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

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

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

Developer Target 1: 99.6% accurate, 1.3× speedup?

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

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

Reproduce

?
herbie shell --seed 2024207 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
  :precision binary64

  :alt
  (! :herbie-platform default (- (* (- z) (+ (+ (* 1/2 (* y y)) y) (* (/ 1/3 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y)))))

  (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))