Average Error: 2.2 → 0.7
Time: 12.3s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \le -4.88920202218507537 \cdot 10^{-16}:\\ \;\;\;\;x \cdot \sqrt[3]{{\left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-\left(a \cdot b + \left(1 \cdot \left(a \cdot z\right) + 0.5 \cdot \left(a \cdot {z}^{2}\right)\right)\right)}\\ \end{array}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\begin{array}{l}
\mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \le -4.88920202218507537 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \sqrt[3]{{\left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right)}^{3}}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{-\left(a \cdot b + \left(1 \cdot \left(a \cdot z\right) + 0.5 \cdot \left(a \cdot {z}^{2}\right)\right)\right)}\\

\end{array}
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)))));
}
double code(double x, double y, double z, double t, double a, double b) {
	double VAR;
	if ((((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= -4.889202022185075e-16)) {
		VAR = (x * cbrt(pow(exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))), 3.0)));
	} else {
		VAR = (x * exp(-((a * b) + ((1.0 * (a * z)) + (0.5 * (a * pow(z, 2.0)))))));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) < -4.889202022185075e-16

    1. Initial program 0.2

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube0.2

      \[\leadsto x \cdot \color{blue}{\sqrt[3]{\left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right) \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}}}\]
    4. Simplified0.2

      \[\leadsto x \cdot \sqrt[3]{\color{blue}{{\left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right)}^{3}}}\]

    if -4.889202022185075e-16 < (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))

    1. Initial program 6.6

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right)} - b\right)}\]
    3. Taylor expanded around inf 1.9

      \[\leadsto x \cdot e^{\color{blue}{-\left(a \cdot b + \left(1 \cdot \left(a \cdot z\right) + 0.5 \cdot \left(a \cdot {z}^{2}\right)\right)\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \le -4.88920202218507537 \cdot 10^{-16}:\\ \;\;\;\;x \cdot \sqrt[3]{{\left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-\left(a \cdot b + \left(1 \cdot \left(a \cdot z\right) + 0.5 \cdot \left(a \cdot {z}^{2}\right)\right)\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2020079 
(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 z)) b))))))