Average Error: 2.0 → 0.8
Time: 9.1s
Precision: binary64
\[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 -7.42307719326287033 \cdot 10^{-15}:\\ \;\;\;\;x \cdot e^{\left(y \cdot \left(2 \cdot \log \left(\sqrt[3]{z}\right)\right) + y \cdot \left(\log \left(\sqrt[3]{z}\right) - t\right)\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\ \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}\]

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

Derivation

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

    1. Initial program 0.1

      \[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-cube-cbrt0.1

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

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

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

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

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

    if -7.42307719326287033e-15 < (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))

    1. Initial program 6.2

      \[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.5

      \[\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 2.0

      \[\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.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \le -7.42307719326287033 \cdot 10^{-15}:\\ \;\;\;\;x \cdot e^{\left(y \cdot \left(2 \cdot \log \left(\sqrt[3]{z}\right)\right) + y \cdot \left(\log \left(\sqrt[3]{z}\right) - t\right)\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\ \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 2020173 
(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))))))