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

Percentage Accurate: 89.0% → 99.6%
Time: 16.7s
Alternatives: 18
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 89.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.5× speedup?

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

\\
\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.25, y, -0.3333333333333333\right), y, -0.5\right), y, -1\right) \cdot y\right) \cdot \left(z - 1\right) + \log y \cdot \left(x - 1\right)\right) - t
\end{array}
Derivation
  1. Initial program 92.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 \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right)\right)}\right) - t \]
  4. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.6% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1e27 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 5e5

      1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Reproduce

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