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

Percentage Accurate: 96.6% → 96.6%
Time: 13.0s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\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 11 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: 96.6% accurate, 1.0× speedup?

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

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

Alternative 1: 96.6% accurate, 1.0× speedup?

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

\\
e^{\left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y} \cdot x
\end{array}
Derivation
  1. Initial program 96.2%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Add Preprocessing
  3. Final simplification96.2%

    \[\leadsto e^{\left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y} \cdot x \]
  4. Add Preprocessing

Alternative 2: 35.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-x, t \cdot y, x\right)\\
t_2 := 1 \cdot t\_1\\
t_3 := \mathsf{fma}\left(t \cdot y, x, x\right)\\
t_4 := \left(\log \left(1 - z\right) - b\right) \cdot a + \left(\log z - t\right) \cdot y\\
t_5 := 1 \cdot \left(t\_1 \cdot t\_3\right)\\
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{+31}:\\
\;\;\;\;\frac{t\_5}{t\_3}\\

\mathbf{elif}\;t\_4 \leq 5:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;\frac{1}{t\_3} \cdot t\_5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -9.9999999999999996e30

    1. Initial program 98.7%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z} - \color{blue}{\left(\left(t \cdot x\right) \cdot y\right) \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z}} \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \color{blue}{e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z} \cdot \left(x - \left(t \cdot x\right) \cdot y\right)} \]
    5. Applied rewrites65.1%

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

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

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

        \[\leadsto 1 \cdot \left(x - \left(x \cdot t\right) \cdot y\right) \]
      3. Step-by-step derivation
        1. Applied rewrites3.0%

          \[\leadsto 1 \cdot \left(x - \left(x \cdot t\right) \cdot y\right) \]
        2. Step-by-step derivation
          1. Applied rewrites12.4%

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

          if -9.9999999999999996e30 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 5 or 2.00000000000000003e263 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

          1. Initial program 94.0%

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

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

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

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

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

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

              \[\leadsto x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z} - \color{blue}{\left(\left(t \cdot x\right) \cdot y\right) \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z}} \]
            6. distribute-rgt-out--N/A

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

              \[\leadsto \color{blue}{e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z} \cdot \left(x - \left(t \cdot x\right) \cdot y\right)} \]
          5. Applied rewrites78.8%

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

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

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

              \[\leadsto 1 \cdot \left(x - \left(x \cdot t\right) \cdot y\right) \]
            3. Step-by-step derivation
              1. Applied rewrites57.7%

                \[\leadsto 1 \cdot \left(x - \left(x \cdot t\right) \cdot y\right) \]
              2. Step-by-step derivation
                1. Applied rewrites65.0%

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

                if 5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2.00000000000000003e263

                1. Initial program 97.6%

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

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

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

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

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

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

                    \[\leadsto x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z} - \color{blue}{\left(\left(t \cdot x\right) \cdot y\right) \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z}} \]
                  6. distribute-rgt-out--N/A

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

                    \[\leadsto \color{blue}{e^{a \cdot \left(\log \left(1 - z\right) - b\right) + y \cdot \log z} \cdot \left(x - \left(t \cdot x\right) \cdot y\right)} \]
                5. Applied rewrites72.5%

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

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

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

                    \[\leadsto 1 \cdot \left(x - \left(x \cdot t\right) \cdot y\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites14.9%

                      \[\leadsto 1 \cdot \left(x - \left(x \cdot t\right) \cdot y\right) \]
                    2. Step-by-step derivation
                      1. Applied rewrites24.4%

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

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

                    Reproduce

                    ?
                    herbie shell --seed 2024230 
                    (FPCore (x y z t a b)
                      :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
                      :precision binary64
                      (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))