Average Error: 28.7 → 1.5
Time: 7.3m
Precision: 64
Internal Precision: 1408
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.1800019238241644 \cdot 10^{+116}:\\ \;\;\;\;\frac{x \cdot {\left(\frac{1.0 - z}{e^{b}}\right)}^{a}}{e^{\frac{\log z}{y} + \frac{1}{y \cdot t}}}\\ \mathbf{if}\;y \le 7.870676857854245 \cdot 10^{-219}:\\ \;\;\;\;\left(x \cdot e^{\left(\left(\log 1.0 - \left(1.0 \cdot z + \frac{1}{2} \cdot \frac{{z}^{2}}{{1.0}^{2}}\right)\right) - b\right) \cdot a}\right) \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{if}\;y \le 4.4393079520886555 \cdot 10^{+231}:\\ \;\;\;\;\left(x \cdot e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}\right) \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{1.0}{e^{\frac{1}{b}}} - \frac{z}{e^{\frac{1}{b}}}\right)}^{a} \cdot \left(x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\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

Target

Original28.7
Target28.7
Herbie1.5
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)}\]

Derivation

  1. Split input into 4 regimes
  2. if y < -2.1800019238241644e+116

    1. Initial program 54.4

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)}\]
    2. Applied simplify41.1

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

      \[\leadsto \left(x \cdot {\left(\frac{1.0 - z}{e^{b}}\right)}^{a}\right) \cdot \color{blue}{e^{\frac{\log \left(\frac{1}{e^{\frac{1}{t}}}\right) - \log z}{y}}}\]
    4. Applied simplify5.0

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

    if -2.1800019238241644e+116 < y < 7.870676857854245e-219

    1. Initial program 31.4

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)}\]
    2. Applied simplify36.8

      \[\leadsto \color{blue}{\left(x \cdot {\left(\frac{1.0 - z}{e^{b}}\right)}^{a}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}}\]
    3. Using strategy rm
    4. Applied add-exp-log43.5

      \[\leadsto \left(x \cdot {\left(\frac{\color{blue}{e^{\log \left(1.0 - z\right)}}}{e^{b}}\right)}^{a}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\]
    5. Applied div-exp43.5

      \[\leadsto \left(x \cdot {\color{blue}{\left(e^{\log \left(1.0 - z\right) - b}\right)}}^{a}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\]
    6. Applied pow-exp38.8

      \[\leadsto \left(x \cdot \color{blue}{e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\]
    7. Using strategy rm
    8. Applied add-exp-log38.8

      \[\leadsto \left(x \cdot e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}\right) \cdot {\color{blue}{\left(e^{\log \left(\frac{z}{e^{t}}\right)}\right)}}^{y}\]
    9. Applied pow-exp38.8

      \[\leadsto \left(x \cdot e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}\right) \cdot \color{blue}{e^{\log \left(\frac{z}{e^{t}}\right) \cdot y}}\]
    10. Applied simplify31.6

      \[\leadsto \left(x \cdot e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}\right) \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}}\]
    11. Taylor expanded around 0 0.3

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

    if 7.870676857854245e-219 < y < 4.4393079520886555e+231

    1. Initial program 1.0

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)}\]
    2. Applied simplify13.8

      \[\leadsto \color{blue}{\left(x \cdot {\left(\frac{1.0 - z}{e^{b}}\right)}^{a}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}}\]
    3. Using strategy rm
    4. Applied add-exp-log13.8

      \[\leadsto \left(x \cdot {\left(\frac{\color{blue}{e^{\log \left(1.0 - z\right)}}}{e^{b}}\right)}^{a}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\]
    5. Applied div-exp13.8

      \[\leadsto \left(x \cdot {\color{blue}{\left(e^{\log \left(1.0 - z\right) - b}\right)}}^{a}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\]
    6. Applied pow-exp6.6

      \[\leadsto \left(x \cdot \color{blue}{e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\]
    7. Using strategy rm
    8. Applied add-exp-log6.6

      \[\leadsto \left(x \cdot e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}\right) \cdot {\color{blue}{\left(e^{\log \left(\frac{z}{e^{t}}\right)}\right)}}^{y}\]
    9. Applied pow-exp6.6

      \[\leadsto \left(x \cdot e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}\right) \cdot \color{blue}{e^{\log \left(\frac{z}{e^{t}}\right) \cdot y}}\]
    10. Applied simplify1.8

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

    if 4.4393079520886555e+231 < y

    1. Initial program 41.8

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)}\]
    2. Applied simplify20.9

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

      \[\leadsto \left(x \cdot {\color{blue}{\left(1.0 \cdot \frac{1}{e^{\frac{1}{b}}} - \frac{z}{e^{\frac{1}{b}}}\right)}}^{a}\right) \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\]
    4. Applied simplify0.6

      \[\leadsto \color{blue}{{\left(\frac{1.0}{e^{\frac{1}{b}}} - \frac{z}{e^{\frac{1}{b}}}\right)}^{a} \cdot \left(x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\right)}\]
  3. Recombined 4 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 7.3m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"

  :herbie-target
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))

  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))