Average Error: 2.0 → 7.6
Time: 11.7s
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 \le -2.2357795218145826 \cdot 10^{57} \lor \neg \left(y \le 2.14655314281410746 \cdot 10^{-72}\right):\\ \;\;\;\;x \cdot {e}^{\left(y \cdot \left(\log z - t\right) + \log 1 \cdot a\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 < -2.2357795218145826e57 or 2.14655314281410746e-72 < y

    1. Initial program 1.3

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

      \[\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 0 7.9

      \[\leadsto x \cdot e^{\color{blue}{\left(\log 1 \cdot y + \left(\log z \cdot y + a \cdot \log 1\right)\right) - t \cdot y}}\]
    4. Simplified7.8

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) + \log 1 \cdot a}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity7.8

      \[\leadsto x \cdot e^{\color{blue}{1 \cdot \left(y \cdot \left(\log z - t\right) + \log 1 \cdot a\right)}}\]
    7. Applied exp-prod7.8

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

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

    if -2.2357795218145826e57 < y < 2.14655314281410746e-72

    1. Initial program 2.5

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

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

      \[\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 simplification7.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.2357795218145826 \cdot 10^{57} \lor \neg \left(y \le 2.14655314281410746 \cdot 10^{-72}\right):\\ \;\;\;\;x \cdot {e}^{\left(y \cdot \left(\log z - t\right) + \log 1 \cdot a\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 2020161 
(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))))))