Average Error: 1.4 → 1.8
Time: 3.8m
Precision: 64
Internal precision: 128
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)}\]
\[e^{\left(\log z - t\right) \cdot y} \cdot \left(x \cdot e^{\left(\log \left(1.0 - z\right) - b\right) \cdot a}\right)\]

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

Original1.4
Comparison1.4
Herbie1.8
\[ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1.0 - z\right) - b\right)} \]

Derivation

  1. Initial program 1.4

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

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

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

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

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

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

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

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

Runtime

Time bar (total: 3.8m) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2976024640 171482483 775400303 2339030997 865634886 1047476539)'
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"

  :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))))))