Average Error: 0.3 → 0.3
Time: 12.7s
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]{\sqrt{z}}\right), \log \left(x + y\right)\right) + \log \left(\sqrt[3]{\sqrt{z}}\right)\right) + \log \left(\sqrt{z}\right)\right) + \mathsf{fma}\left(\log t, a - 0.5, -t\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]{\sqrt{z}}\right), \log \left(x + y\right)\right) + \log \left(\sqrt[3]{\sqrt{z}}\right)\right) + \log \left(\sqrt{z}\right)\right) + \mathsf{fma}\left(\log t, a - 0.5, -t\right)
double f(double x, double y, double z, double t, double a) {
        double r339716 = x;
        double r339717 = y;
        double r339718 = r339716 + r339717;
        double r339719 = log(r339718);
        double r339720 = z;
        double r339721 = log(r339720);
        double r339722 = r339719 + r339721;
        double r339723 = t;
        double r339724 = r339722 - r339723;
        double r339725 = a;
        double r339726 = 0.5;
        double r339727 = r339725 - r339726;
        double r339728 = log(r339723);
        double r339729 = r339727 * r339728;
        double r339730 = r339724 + r339729;
        return r339730;
}

double f(double x, double y, double z, double t, double a) {
        double r339731 = 2.0;
        double r339732 = z;
        double r339733 = sqrt(r339732);
        double r339734 = cbrt(r339733);
        double r339735 = log(r339734);
        double r339736 = x;
        double r339737 = y;
        double r339738 = r339736 + r339737;
        double r339739 = log(r339738);
        double r339740 = fma(r339731, r339735, r339739);
        double r339741 = r339740 + r339735;
        double r339742 = log(r339733);
        double r339743 = r339741 + r339742;
        double r339744 = t;
        double r339745 = log(r339744);
        double r339746 = a;
        double r339747 = 0.5;
        double r339748 = r339746 - r339747;
        double r339749 = -r339744;
        double r339750 = fma(r339745, r339748, r339749);
        double r339751 = r339743 + r339750;
        return r339751;
}

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 sub-neg0.3

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

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

    \[\leadsto \left(\log \left(x + y\right) + \log z\right) + \color{blue}{\mathsf{fma}\left(\log t, a - 0.5, -t\right)}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.3

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

    \[\leadsto \left(\log \left(x + y\right) + \color{blue}{\left(\log \left(\sqrt{z}\right) + \log \left(\sqrt{z}\right)\right)}\right) + \mathsf{fma}\left(\log t, a - 0.5, -t\right)\]
  9. Applied associate-+r+0.3

    \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log \left(\sqrt{z}\right)\right) + \log \left(\sqrt{z}\right)\right)} + \mathsf{fma}\left(\log t, a - 0.5, -t\right)\]
  10. Using strategy rm
  11. Applied add-cube-cbrt0.3

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

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

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

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

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

Reproduce

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