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

Percentage Accurate: 89.1% → 99.8%
Time: 13.2s
Alternatives: 16
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 89.1% 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.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(x - 1\right) - t\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 1.6× speedup?

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 1.6× speedup?

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

\\
\mathsf{fma}\left(z - 1, \left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y - 1\right) \cdot y, \log y \cdot \left(x - 1\right) - t\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.4% accurate, 1.7× speedup?

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

\\
\mathsf{fma}\left(\log y, x - 1, \left(\left(z - 1\right) \cdot \mathsf{fma}\left(-0.5, y, -1\right)\right) \cdot y\right) - t
\end{array}
Derivation
  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(-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. remove-double-negN/A

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(-1 + x, \log y, \left(-y\right) \cdot \left(z - 1\right)\right)} - t \]
  6. 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 \]
  7. Step-by-step derivation
    1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 94.7% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.85e17

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.85e17 < x < 8.50000000000000014e36

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

      if 8.50000000000000014e36 < x

      1. Initial program 95.7%

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

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

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

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

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

    Alternative 6: 89.8% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+273} \lor \neg \left(z \leq 9.8 \cdot 10^{+185}\right):\\ \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x - 1, y\right) - t\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (or (<= z -2.15e+273) (not (<= z 9.8e+185)))
       (- (* (* (- (* -0.5 y) 1.0) z) y) t)
       (- (fma (log y) (- x 1.0) y) t)))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if ((z <= -2.15e+273) || !(z <= 9.8e+185)) {
    		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
    	} else {
    		tmp = fma(log(y), (x - 1.0), y) - t;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if ((z <= -2.15e+273) || !(z <= 9.8e+185))
    		tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t);
    	else
    		tmp = Float64(fma(log(y), Float64(x - 1.0), y) - t);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.15e+273], N[Not[LessEqual[z, 9.8e+185]], $MachinePrecision]], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision] + y), $MachinePrecision] - t), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -2.15 \cdot 10^{+273} \lor \neg \left(z \leq 9.8 \cdot 10^{+185}\right):\\
    \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\log y, x - 1, y\right) - t\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -2.15000000000000008e273 or 9.79999999999999968e185 < z

      1. Initial program 44.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(-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. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(z - 1\right) \cdot \mathsf{fma}\left(\frac{-1}{2}, y, -1\right), y, \color{blue}{\log y} \cdot \left(x - 1\right)\right) - t \]
          11. lower--.f6492.6

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

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

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

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

          if -2.15000000000000008e273 < z < 9.79999999999999968e185

          1. Initial program 95.3%

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

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

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

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

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

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

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

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

          Alternative 7: 89.7% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+273} \lor \neg \left(z \leq 9.8 \cdot 10^{+185}\right):\\ \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1 + x, \log y, -t\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (or (<= z -2.15e+273) (not (<= z 9.8e+185)))
             (- (* (* (- (* -0.5 y) 1.0) z) y) t)
             (fma (+ -1.0 x) (log y) (- t))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if ((z <= -2.15e+273) || !(z <= 9.8e+185)) {
          		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
          	} else {
          		tmp = fma((-1.0 + x), log(y), -t);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if ((z <= -2.15e+273) || !(z <= 9.8e+185))
          		tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t);
          	else
          		tmp = fma(Float64(-1.0 + x), log(y), Float64(-t));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.15e+273], N[Not[LessEqual[z, 9.8e+185]], $MachinePrecision]], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -2.15 \cdot 10^{+273} \lor \neg \left(z \leq 9.8 \cdot 10^{+185}\right):\\
          \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(-1 + x, \log y, -t\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -2.15000000000000008e273 or 9.79999999999999968e185 < z

            1. Initial program 44.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(-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. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(z - 1\right) \cdot \mathsf{fma}\left(\frac{-1}{2}, y, -1\right), y, \color{blue}{\log y} \cdot \left(x - 1\right)\right) - t \]
                11. lower--.f6492.6

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

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

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

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

                if -2.15000000000000008e273 < z < 9.79999999999999968e185

                1. Initial program 95.3%

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

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

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

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

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

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

              Alternative 8: 86.3% accurate, 1.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1800 \lor \neg \left(x \leq 8.5 \cdot 10^{+36}\right):\\ \;\;\;\;\log y \cdot x - t\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= x -1800.0) (not (<= x 8.5e+36)))
                 (- (* (log y) x) t)
                 (- (- y (log y)) t)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((x <= -1800.0) || !(x <= 8.5e+36)) {
              		tmp = (log(y) * x) - t;
              	} else {
              		tmp = (y - log(y)) - t;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: tmp
                  if ((x <= (-1800.0d0)) .or. (.not. (x <= 8.5d+36))) then
                      tmp = (log(y) * x) - t
                  else
                      tmp = (y - log(y)) - t
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((x <= -1800.0) || !(x <= 8.5e+36)) {
              		tmp = (Math.log(y) * x) - t;
              	} else {
              		tmp = (y - Math.log(y)) - t;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	tmp = 0
              	if (x <= -1800.0) or not (x <= 8.5e+36):
              		tmp = (math.log(y) * x) - t
              	else:
              		tmp = (y - math.log(y)) - t
              	return tmp
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((x <= -1800.0) || !(x <= 8.5e+36))
              		tmp = Float64(Float64(log(y) * x) - t);
              	else
              		tmp = Float64(Float64(y - log(y)) - t);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	tmp = 0.0;
              	if ((x <= -1800.0) || ~((x <= 8.5e+36)))
              		tmp = (log(y) * x) - t;
              	else
              		tmp = (y - log(y)) - t;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1800.0], N[Not[LessEqual[x, 8.5e+36]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq -1800 \lor \neg \left(x \leq 8.5 \cdot 10^{+36}\right):\\
              \;\;\;\;\log y \cdot x - t\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(y - \log y\right) - t\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -1800 or 8.50000000000000014e36 < x

                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} - t \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                if -1800 < x < 8.50000000000000014e36

                1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1800 \lor \neg \left(x \leq 8.5 \cdot 10^{+36}\right):\\ \;\;\;\;\log y \cdot x - t\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 9: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

                    Alternative 10: 76.5% accurate, 1.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{+18} \lor \neg \left(x \leq 9.4 \cdot 10^{+36}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (if (or (<= x -2.25e+18) (not (<= x 9.4e+36)))
                       (* (log y) x)
                       (- (- y (log y)) t)))
                    double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if ((x <= -2.25e+18) || !(x <= 9.4e+36)) {
                    		tmp = log(y) * x;
                    	} else {
                    		tmp = (y - log(y)) - t;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(x, y, z, t)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8) :: tmp
                        if ((x <= (-2.25d+18)) .or. (.not. (x <= 9.4d+36))) then
                            tmp = log(y) * x
                        else
                            tmp = (y - log(y)) - t
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if ((x <= -2.25e+18) || !(x <= 9.4e+36)) {
                    		tmp = Math.log(y) * x;
                    	} else {
                    		tmp = (y - Math.log(y)) - t;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t):
                    	tmp = 0
                    	if (x <= -2.25e+18) or not (x <= 9.4e+36):
                    		tmp = math.log(y) * x
                    	else:
                    		tmp = (y - math.log(y)) - t
                    	return tmp
                    
                    function code(x, y, z, t)
                    	tmp = 0.0
                    	if ((x <= -2.25e+18) || !(x <= 9.4e+36))
                    		tmp = Float64(log(y) * x);
                    	else
                    		tmp = Float64(Float64(y - log(y)) - t);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t)
                    	tmp = 0.0;
                    	if ((x <= -2.25e+18) || ~((x <= 9.4e+36)))
                    		tmp = log(y) * x;
                    	else
                    		tmp = (y - log(y)) - t;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.25e+18], N[Not[LessEqual[x, 9.4e+36]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;x \leq -2.25 \cdot 10^{+18} \lor \neg \left(x \leq 9.4 \cdot 10^{+36}\right):\\
                    \;\;\;\;\log y \cdot x\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(y - \log y\right) - t\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if x < -2.25e18 or 9.39999999999999978e36 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\log y} \cdot x \]
                        11. lower-log.f6474.9

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

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

                      if -2.25e18 < x < 9.39999999999999978e36

                      1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{+18} \lor \neg \left(x \leq 9.4 \cdot 10^{+36}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \end{array} \]
                        6. Add Preprocessing

                        Alternative 11: 76.4% accurate, 1.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{+18} \lor \neg \left(x \leq 9.4 \cdot 10^{+36}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;-\left(\log y + t\right)\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (or (<= x -2.25e+18) (not (<= x 9.4e+36)))
                           (* (log y) x)
                           (- (+ (log y) t))))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if ((x <= -2.25e+18) || !(x <= 9.4e+36)) {
                        		tmp = log(y) * x;
                        	} else {
                        		tmp = -(log(y) + t);
                        	}
                        	return tmp;
                        }
                        
                        real(8) function code(x, y, z, t)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            real(8) :: tmp
                            if ((x <= (-2.25d+18)) .or. (.not. (x <= 9.4d+36))) then
                                tmp = log(y) * x
                            else
                                tmp = -(log(y) + t)
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if ((x <= -2.25e+18) || !(x <= 9.4e+36)) {
                        		tmp = Math.log(y) * x;
                        	} else {
                        		tmp = -(Math.log(y) + t);
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if (x <= -2.25e+18) or not (x <= 9.4e+36):
                        		tmp = math.log(y) * x
                        	else:
                        		tmp = -(math.log(y) + t)
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if ((x <= -2.25e+18) || !(x <= 9.4e+36))
                        		tmp = Float64(log(y) * x);
                        	else
                        		tmp = Float64(-Float64(log(y) + t));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if ((x <= -2.25e+18) || ~((x <= 9.4e+36)))
                        		tmp = log(y) * x;
                        	else
                        		tmp = -(log(y) + t);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.25e+18], N[Not[LessEqual[x, 9.4e+36]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], (-N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision])]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -2.25 \cdot 10^{+18} \lor \neg \left(x \leq 9.4 \cdot 10^{+36}\right):\\
                        \;\;\;\;\log y \cdot x\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;-\left(\log y + t\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -2.25e18 or 9.39999999999999978e36 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\log y} \cdot x \]
                            11. lower-log.f6474.9

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

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

                          if -2.25e18 < x < 9.39999999999999978e36

                          1. Initial program 86.0%

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

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

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

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

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{+18} \lor \neg \left(x \leq 9.4 \cdot 10^{+36}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;-\left(\log y + t\right)\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 12: 66.8% accurate, 1.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.35 \cdot 10^{+18} \lor \neg \left(x \leq 3 \cdot 10^{+37}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\ \end{array} \end{array} \]
                          (FPCore (x y z t)
                           :precision binary64
                           (if (or (<= x -4.35e+18) (not (<= x 3e+37)))
                             (* (log y) x)
                             (- (* (* (- (* -0.5 y) 1.0) z) y) t)))
                          double code(double x, double y, double z, double t) {
                          	double tmp;
                          	if ((x <= -4.35e+18) || !(x <= 3e+37)) {
                          		tmp = log(y) * x;
                          	} else {
                          		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, y, z, t)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8) :: tmp
                              if ((x <= (-4.35d+18)) .or. (.not. (x <= 3d+37))) then
                                  tmp = log(y) * x
                              else
                                  tmp = (((((-0.5d0) * y) - 1.0d0) * z) * y) - t
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t) {
                          	double tmp;
                          	if ((x <= -4.35e+18) || !(x <= 3e+37)) {
                          		tmp = Math.log(y) * x;
                          	} else {
                          		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t):
                          	tmp = 0
                          	if (x <= -4.35e+18) or not (x <= 3e+37):
                          		tmp = math.log(y) * x
                          	else:
                          		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t
                          	return tmp
                          
                          function code(x, y, z, t)
                          	tmp = 0.0
                          	if ((x <= -4.35e+18) || !(x <= 3e+37))
                          		tmp = Float64(log(y) * x);
                          	else
                          		tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t)
                          	tmp = 0.0;
                          	if ((x <= -4.35e+18) || ~((x <= 3e+37)))
                          		tmp = log(y) * x;
                          	else
                          		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.35e+18], N[Not[LessEqual[x, 3e+37]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;x \leq -4.35 \cdot 10^{+18} \lor \neg \left(x \leq 3 \cdot 10^{+37}\right):\\
                          \;\;\;\;\log y \cdot x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -4.35e18 or 3.00000000000000022e37 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\log y} \cdot x \]
                              11. lower-log.f6474.9

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

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

                            if -4.35e18 < x < 3.00000000000000022e37

                            1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 13: 46.0% accurate, 10.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 14: 45.9% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 15: 45.7% accurate, 20.5× speedup?

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

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

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

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

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

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

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

                                          Alternative 16: 35.2% accurate, 75.3× speedup?

                                          \[\begin{array}{l} \\ -t \end{array} \]
                                          (FPCore (x y z t) :precision binary64 (- t))
                                          double code(double x, double y, double z, double t) {
                                          	return -t;
                                          }
                                          
                                          real(8) function code(x, y, z, t)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              real(8), intent (in) :: z
                                              real(8), intent (in) :: t
                                              code = -t
                                          end function
                                          
                                          public static double code(double x, double y, double z, double t) {
                                          	return -t;
                                          }
                                          
                                          def code(x, y, z, t):
                                          	return -t
                                          
                                          function code(x, y, z, t)
                                          	return Float64(-t)
                                          end
                                          
                                          function tmp = code(x, y, z, t)
                                          	tmp = -t;
                                          end
                                          
                                          code[x_, y_, z_, t_] := (-t)
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          -t
                                          \end{array}
                                          
                                          Derivation
                                          1. Initial program 89.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. lower-neg.f6437.5

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

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

                                          Reproduce

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