Average Error: 9.2 → 0.4
Time: 15.8s
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), \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(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left(\sqrt[3]{y}\right), \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 r563826 = x;
        double r563827 = y;
        double r563828 = log(r563827);
        double r563829 = r563826 * r563828;
        double r563830 = z;
        double r563831 = 1.0;
        double r563832 = r563831 - r563827;
        double r563833 = log(r563832);
        double r563834 = r563830 * r563833;
        double r563835 = r563829 + r563834;
        double r563836 = t;
        double r563837 = r563835 - r563836;
        return r563837;
}

double f(double x, double y, double z, double t) {
        double r563838 = x;
        double r563839 = y;
        double r563840 = cbrt(r563839);
        double r563841 = r563840 * r563840;
        double r563842 = log(r563841);
        double r563843 = r563838 * r563842;
        double r563844 = log(r563840);
        double r563845 = z;
        double r563846 = 1.0;
        double r563847 = log(r563846);
        double r563848 = r563846 * r563839;
        double r563849 = r563847 - r563848;
        double r563850 = 2.0;
        double r563851 = pow(r563839, r563850);
        double r563852 = r563845 * r563851;
        double r563853 = pow(r563846, r563850);
        double r563854 = r563852 / r563853;
        double r563855 = -0.5;
        double r563856 = r563854 * r563855;
        double r563857 = fma(r563845, r563849, r563856);
        double r563858 = fma(r563838, r563844, r563857);
        double r563859 = r563843 + r563858;
        double r563860 = t;
        double r563861 = r563859 - r563860;
        return r563861;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

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

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

    \[\leadsto \left(x \cdot \log y + \color{blue}{\left(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)}\right) - t\]
  3. Simplified0.3

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

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

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

    \[\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)} + \left(z \cdot \left(\log 1 - 1 \cdot y\right) - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\]
  8. Applied associate-+l+0.4

    \[\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) + \left(z \cdot \left(\log 1 - 1 \cdot y\right) - \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)} - t\]
  9. Simplified0.4

    \[\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), \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 simplification0.4

    \[\leadsto \left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left(\sqrt[3]{y}\right), \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 2020042 +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))