Average Error: 9.1 → 0.5
Time: 14.4s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left(\sqrt[3]{y}\right), z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left(\sqrt[3]{y}\right), z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r431765 = x;
        double r431766 = y;
        double r431767 = log(r431766);
        double r431768 = r431765 * r431767;
        double r431769 = z;
        double r431770 = 1.0;
        double r431771 = r431770 - r431766;
        double r431772 = log(r431771);
        double r431773 = r431769 * r431772;
        double r431774 = r431768 + r431773;
        double r431775 = t;
        double r431776 = r431774 - r431775;
        return r431776;
}

double f(double x, double y, double z, double t) {
        double r431777 = x;
        double r431778 = y;
        double r431779 = cbrt(r431778);
        double r431780 = r431779 * r431779;
        double r431781 = log(r431780);
        double r431782 = r431777 * r431781;
        double r431783 = log(r431779);
        double r431784 = z;
        double r431785 = 1.0;
        double r431786 = log(r431785);
        double r431787 = 0.5;
        double r431788 = 2.0;
        double r431789 = pow(r431778, r431788);
        double r431790 = pow(r431785, r431788);
        double r431791 = r431789 / r431790;
        double r431792 = r431787 * r431791;
        double r431793 = fma(r431785, r431778, r431792);
        double r431794 = r431786 - r431793;
        double r431795 = r431784 * r431794;
        double r431796 = fma(r431777, r431783, r431795);
        double r431797 = r431782 + r431796;
        double r431798 = t;
        double r431799 = r431797 - r431798;
        return r431799;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.1
Target0.3
Herbie0.5
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.333333333333333315}{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.1

    \[\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. Simplified0.4

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

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

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

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

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

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

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

Reproduce

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