Average Error: 9.3 → 0.4
Time: 8.1s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right), z, \mathsf{fma}\left(x, 2 \cdot \log \left(\sqrt[3]{y}\right), x \cdot \log \left(\sqrt[3]{y}\right)\right) - t\right) + \mathsf{fma}\left(-t, 1, t\right)\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right), z, \mathsf{fma}\left(x, 2 \cdot \log \left(\sqrt[3]{y}\right), x \cdot \log \left(\sqrt[3]{y}\right)\right) - t\right) + \mathsf{fma}\left(-t, 1, t\right)
double f(double x, double y, double z, double t) {
        double r452740 = x;
        double r452741 = y;
        double r452742 = log(r452741);
        double r452743 = r452740 * r452742;
        double r452744 = z;
        double r452745 = 1.0;
        double r452746 = r452745 - r452741;
        double r452747 = log(r452746);
        double r452748 = r452744 * r452747;
        double r452749 = r452743 + r452748;
        double r452750 = t;
        double r452751 = r452749 - r452750;
        return r452751;
}

double f(double x, double y, double z, double t) {
        double r452752 = 1.0;
        double r452753 = log(r452752);
        double r452754 = y;
        double r452755 = 0.5;
        double r452756 = 2.0;
        double r452757 = pow(r452754, r452756);
        double r452758 = pow(r452752, r452756);
        double r452759 = r452757 / r452758;
        double r452760 = r452755 * r452759;
        double r452761 = fma(r452752, r452754, r452760);
        double r452762 = r452753 - r452761;
        double r452763 = z;
        double r452764 = x;
        double r452765 = cbrt(r452754);
        double r452766 = log(r452765);
        double r452767 = r452756 * r452766;
        double r452768 = r452764 * r452766;
        double r452769 = fma(r452764, r452767, r452768);
        double r452770 = t;
        double r452771 = r452769 - r452770;
        double r452772 = fma(r452762, r452763, r452771);
        double r452773 = -r452770;
        double r452774 = 1.0;
        double r452775 = fma(r452773, r452774, r452770);
        double r452776 = r452772 + r452775;
        return r452776;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.3
Target0.3
Herbie0.4
\[\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.3

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
  2. Taylor expanded around 0 0.4

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.9

    \[\leadsto \left(x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - \color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}\]
  5. Applied add-sqr-sqrt32.6

    \[\leadsto \color{blue}{\sqrt{x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)} \cdot \sqrt{x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)}} - \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\]
  6. Applied prod-diff32.6

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right), z, \left(\color{blue}{x \cdot \left(2 \cdot \log \left(\sqrt[3]{y}\right)\right)} + x \cdot \log \left(\sqrt[3]{y}\right)\right) - t\right) + \mathsf{fma}\left(-t, 1, t\right)\]
  14. Using strategy rm
  15. Applied fma-def0.4

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

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

Reproduce

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