Average Error: 1.9 → 0.2
Time: 9.5s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[x \cdot e^{\mathsf{fma}\left(y, \log z, \mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, y \cdot \left(-t\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^{\mathsf{fma}\left(y, \log z, \mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, y \cdot \left(-t\right)\right)\right)}
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(fma(y, log(z), fma((log(1.0) - (fma(0.5, (pow(z, 2.0) / pow(1.0, 2.0)), (1.0 * z)) + b)), a, (y * -t)))));
}

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 1.9

    \[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(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right)} - b\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.5

    \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z + \left(-t\right)\right)} + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)}\]
  5. Applied distribute-lft-in0.5

    \[\leadsto x \cdot e^{\color{blue}{\left(y \cdot \log z + y \cdot \left(-t\right)\right)} + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)}\]
  6. Applied associate-+l+0.5

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

    \[\leadsto x \cdot e^{y \cdot \log z + \color{blue}{\mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, y \cdot \left(-t\right)\right)}}\]
  8. Using strategy rm
  9. Applied fma-def0.2

    \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z, \mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, y \cdot \left(-t\right)\right)\right)}}\]
  10. Final simplification0.2

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

Reproduce

herbie shell --seed 2020071 +o rules:numerics
(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 z)) b))))))