Average Error: 2.2 → 0.3
Time: 12.8s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[\left(x \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}\right) \cdot \left(\left|\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}\right| \cdot \sqrt{\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}}\right)\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\left(x \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}\right) \cdot \left(\left|\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}\right| \cdot \sqrt{\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}}\right)
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) (((double) (x * ((double) sqrt(((double) exp(((double) fma(y, ((double) (((double) log(z)) - t)), ((double) (a * ((double) (((double) (((double) log(1.0)) - ((double) (((double) (0.5 * ((double) (((double) pow(z, 2.0)) / ((double) pow(1.0, 2.0)))))) + ((double) (1.0 * z)))))) - b)))))))))))) * ((double) (((double) fabs(((double) cbrt(((double) exp(((double) fma(y, ((double) (((double) log(z)) - t)), ((double) (a * ((double) (((double) (((double) log(1.0)) - ((double) (((double) (0.5 * ((double) (((double) pow(z, 2.0)) / ((double) pow(1.0, 2.0)))))) + ((double) (1.0 * z)))))) - b)))))))))))) * ((double) sqrt(((double) cbrt(((double) exp(((double) fma(y, ((double) (((double) log(z)) - t)), ((double) (a * ((double) (((double) (((double) log(1.0)) - ((double) (((double) (0.5 * ((double) (((double) pow(z, 2.0)) / ((double) pow(1.0, 2.0)))))) + ((double) (1.0 * z)))))) - 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 2.2

    \[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 fma-def0.3

    \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.3

    \[\leadsto x \cdot \color{blue}{\left(\sqrt{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}} \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)\right)}}\right)}\]
  7. Applied associate-*r*0.3

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

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

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

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

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

Reproduce

herbie shell --seed 2020121 +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))))))