Average Error: 2.3 → 0.7
Time: 7.3s
Precision: binary64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 + \left(\left(z \cdot \frac{z}{1 \cdot 1}\right) \cdot -0.5 - z \cdot 1\right)\right) - b\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 + \left(\left(z \cdot \frac{z}{1 \cdot 1}\right) \cdot -0.5 - z \cdot 1\right)\right) - b\right)}
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
(FPCore (x y z t a b)
 :precision binary64
 (*
  x
  (exp
   (+
    (* y (- (log z) t))
    (*
     a
     (- (+ (log 1.0) (- (* (* z (/ z (* 1.0 1.0))) -0.5) (* z 1.0))) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return ((double) (x * ((double) exp(((double) (((double) (y * ((double) (((double) log(z)) - t)))) + ((double) (a * ((double) (((double) log(((double) (1.0 - z)))) - b))))))))));
}
double code(double x, double y, double z, double t, double a, double b) {
	return ((double) (x * ((double) exp(((double) (((double) (y * ((double) (((double) log(z)) - t)))) + ((double) (a * ((double) (((double) (((double) log(1.0)) + ((double) (((double) (((double) (z * (z / ((double) (1.0 * 1.0))))) * -0.5)) - ((double) (z * 1.0)))))) - b))))))))));
}

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. Initial program Error: 2.3 bits

    \[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 Error: 0.7 bits

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\log 1 - \left(0.5 \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right)} - b\right)}\]
  3. SimplifiedError: 0.7 bits

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\log 1 + \left(\left(z \cdot \frac{z}{1 \cdot 1}\right) \cdot -0.5 - 1 \cdot z\right)\right)} - b\right)}\]
  4. Final simplificationError: 0.7 bits

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

Reproduce

herbie shell --seed 2020204 
(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))))))