Average Error: 0.3 → 0.3
Time: 2.2m
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\mathsf{fma}\left(\left(a - 0.5\right), \left(\log t\right), \left(\log \left(x + y\right)\right)\right) + \left(\log z - t\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\mathsf{fma}\left(\left(a - 0.5\right), \left(\log t\right), \left(\log \left(x + y\right)\right)\right) + \left(\log z - t\right)
double f(double x, double y, double z, double t, double a) {
        double r13682309 = x;
        double r13682310 = y;
        double r13682311 = r13682309 + r13682310;
        double r13682312 = log(r13682311);
        double r13682313 = z;
        double r13682314 = log(r13682313);
        double r13682315 = r13682312 + r13682314;
        double r13682316 = t;
        double r13682317 = r13682315 - r13682316;
        double r13682318 = a;
        double r13682319 = 0.5;
        double r13682320 = r13682318 - r13682319;
        double r13682321 = log(r13682316);
        double r13682322 = r13682320 * r13682321;
        double r13682323 = r13682317 + r13682322;
        return r13682323;
}

double f(double x, double y, double z, double t, double a) {
        double r13682324 = a;
        double r13682325 = 0.5;
        double r13682326 = r13682324 - r13682325;
        double r13682327 = t;
        double r13682328 = log(r13682327);
        double r13682329 = x;
        double r13682330 = y;
        double r13682331 = r13682329 + r13682330;
        double r13682332 = log(r13682331);
        double r13682333 = fma(r13682326, r13682328, r13682332);
        double r13682334 = z;
        double r13682335 = log(r13682334);
        double r13682336 = r13682335 - r13682327;
        double r13682337 = r13682333 + r13682336;
        return r13682337;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

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-rgt-in0.3

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

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

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

    \[\leadsto \left(\left(\log z - t\right) + \mathsf{fma}\left(\left(\log \color{blue}{\left({t}^{\frac{2}{3}}\right)}\right), \left(a - 0.5\right), \left(\log \left(y + x\right)\right)\right)\right) + \log \left(\sqrt[3]{t}\right) \cdot \left(a - 0.5\right)\]
  9. Using strategy rm
  10. Applied associate-+l+0.3

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

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

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

Reproduce

herbie shell --seed 2019125 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))