Average Error: 0.3 → 0.3
Time: 11.6s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\left(\left(\mathsf{fma}\left(2, \log \left(\sqrt[3]{z}\right), \log \left(x + y\right)\right) + \log \left(\sqrt[3]{z}\right)\right) - t\right) + \left(\mathsf{fma}\left(\log \left({t}^{\frac{1}{3}}\right), 2, \log \left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right)\right) \cdot \left(a - 0.5\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{t}}\right)\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\left(\left(\mathsf{fma}\left(2, \log \left(\sqrt[3]{z}\right), \log \left(x + y\right)\right) + \log \left(\sqrt[3]{z}\right)\right) - t\right) + \left(\mathsf{fma}\left(\log \left({t}^{\frac{1}{3}}\right), 2, \log \left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right)\right) \cdot \left(a - 0.5\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{t}}\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r293857 = x;
        double r293858 = y;
        double r293859 = r293857 + r293858;
        double r293860 = log(r293859);
        double r293861 = z;
        double r293862 = log(r293861);
        double r293863 = r293860 + r293862;
        double r293864 = t;
        double r293865 = r293863 - r293864;
        double r293866 = a;
        double r293867 = 0.5;
        double r293868 = r293866 - r293867;
        double r293869 = log(r293864);
        double r293870 = r293868 * r293869;
        double r293871 = r293865 + r293870;
        return r293871;
}

double f(double x, double y, double z, double t, double a) {
        double r293872 = 2.0;
        double r293873 = z;
        double r293874 = cbrt(r293873);
        double r293875 = log(r293874);
        double r293876 = x;
        double r293877 = y;
        double r293878 = r293876 + r293877;
        double r293879 = log(r293878);
        double r293880 = fma(r293872, r293875, r293879);
        double r293881 = r293880 + r293875;
        double r293882 = t;
        double r293883 = r293881 - r293882;
        double r293884 = 0.3333333333333333;
        double r293885 = pow(r293882, r293884);
        double r293886 = log(r293885);
        double r293887 = cbrt(r293882);
        double r293888 = r293887 * r293887;
        double r293889 = cbrt(r293888);
        double r293890 = log(r293889);
        double r293891 = fma(r293886, r293872, r293890);
        double r293892 = a;
        double r293893 = 0.5;
        double r293894 = r293892 - r293893;
        double r293895 = r293891 * r293894;
        double r293896 = cbrt(r293887);
        double r293897 = log(r293896);
        double r293898 = r293894 * r293897;
        double r293899 = r293895 + r293898;
        double r293900 = r293883 + r293899;
        return r293900;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original0.3
Target0.3
Herbie0.3
\[\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)\]

Derivation

  1. Initial program 0.3

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log \color{blue}{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right)}\]
  4. Applied log-prod0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\left(\log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + \log \left(\sqrt[3]{t}\right)\right)}\]
  5. Applied distribute-lft-in0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(\left(a - 0.5\right) \cdot \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{t}\right)\right)}\]
  6. Simplified0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(\color{blue}{\left(a - 0.5\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right)} + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{t}\right)\right)\]
  7. Using strategy rm
  8. Applied add-cube-cbrt0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(\left(a - 0.5\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\right)\right)\]
  9. Applied cbrt-prod0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(\left(a - 0.5\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right) + \left(a - 0.5\right) \cdot \log \color{blue}{\left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \sqrt[3]{\sqrt[3]{t}}\right)}\right)\]
  10. Applied log-prod0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(\left(a - 0.5\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right) + \left(a - 0.5\right) \cdot \color{blue}{\left(\log \left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) + \log \left(\sqrt[3]{\sqrt[3]{t}}\right)\right)}\right)\]
  11. Applied distribute-lft-in0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(\left(a - 0.5\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right) + \color{blue}{\left(\left(a - 0.5\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{t}}\right)\right)}\right)\]
  12. Applied associate-+r+0.3

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(\left(\left(a - 0.5\right) \cdot \left(2 \cdot \log \left(\sqrt[3]{t}\right)\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right)\right) + \left(a - 0.5\right) \cdot \log \left(\sqrt[3]{\sqrt[3]{t}}\right)\right)}\]
  13. Simplified0.3

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020036 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))

  (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))