Average Error: 9.7 → 1.1
Time: 25.1s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}\right) \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}}\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}\right) \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}}\right) - t
double f(double x, double y, double z, double t) {
        double r331908 = x;
        double r331909 = y;
        double r331910 = log(r331909);
        double r331911 = r331908 * r331910;
        double r331912 = z;
        double r331913 = 1.0;
        double r331914 = r331913 - r331909;
        double r331915 = log(r331914);
        double r331916 = r331912 * r331915;
        double r331917 = r331911 + r331916;
        double r331918 = t;
        double r331919 = r331917 - r331918;
        return r331919;
}

double f(double x, double y, double z, double t) {
        double r331920 = x;
        double r331921 = y;
        double r331922 = log(r331921);
        double r331923 = z;
        double r331924 = 1.0;
        double r331925 = log(r331924);
        double r331926 = r331924 * r331921;
        double r331927 = r331925 - r331926;
        double r331928 = 2.0;
        double r331929 = pow(r331921, r331928);
        double r331930 = r331923 * r331929;
        double r331931 = pow(r331924, r331928);
        double r331932 = r331930 / r331931;
        double r331933 = -0.5;
        double r331934 = r331932 * r331933;
        double r331935 = fma(r331923, r331927, r331934);
        double r331936 = fma(r331920, r331922, r331935);
        double r331937 = cbrt(r331936);
        double r331938 = r331937 * r331937;
        double r331939 = cbrt(r331938);
        double r331940 = cbrt(r331937);
        double r331941 = r331939 * r331940;
        double r331942 = r331938 * r331941;
        double r331943 = t;
        double r331944 = r331942 - r331943;
        return r331944;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.7
Target0.3
Herbie1.1
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333148296162562473909929395}{1 \cdot \left(1 \cdot 1\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)\]

Derivation

  1. Initial program 9.7

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
  2. Simplified9.7

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, z \cdot \log \left(1 - y\right)\right) - t}\]
  3. Taylor expanded around 0 0.3

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

    \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)}\right) - t\]
  5. Using strategy rm
  6. Applied add-cube-cbrt1.0

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

    \[\leadsto \left(\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}\right) \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}}} - t\]
  9. Applied cbrt-prod1.1

    \[\leadsto \left(\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)}}\right)} - t\]
  10. Final simplification1.1

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

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))

  (- (+ (* x (log y)) (* z (log (- 1 y)))) t))