Average Error: 2.1 → 0.5
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(b + \left(z + \left(z \cdot z\right) \cdot \left(z \cdot 0.3333333333333333 + 0.5\right)\right)\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(b + \left(z + \left(z \cdot z\right) \cdot \left(z \cdot 0.3333333333333333 + 0.5\right)\right)\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 (+ b (+ z (* (* z z) (+ (* z 0.3333333333333333) 0.5)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp((y * (log(z) - t)) + (a * (log(1.0 - z) - b)));
}
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp((y * (log(z) - t)) - (a * (b + (z + ((z * z) * ((z * 0.3333333333333333) + 0.5))))));
}

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 2.1

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

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

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\left(-z\right) - \left(z \cdot z\right) \cdot \left(0.3333333333333333 \cdot z + 0.5\right)\right)} - b\right)}\]
  4. Final simplification0.5

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

Reproduce

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