Average Error: 0.3 → 0.4
Time: 48.5s
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(\log t, a - 0.5, \mathsf{fma}\left(\sqrt[3]{\log \left(y + x\right)} \cdot \sqrt[3]{\log \left(y + x\right)}, \sqrt[3]{\log \left(y + x\right)}, \log z - t\right)\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\mathsf{fma}\left(\log t, a - 0.5, \mathsf{fma}\left(\sqrt[3]{\log \left(y + x\right)} \cdot \sqrt[3]{\log \left(y + x\right)}, \sqrt[3]{\log \left(y + x\right)}, \log z - t\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r3688477 = x;
        double r3688478 = y;
        double r3688479 = r3688477 + r3688478;
        double r3688480 = log(r3688479);
        double r3688481 = z;
        double r3688482 = log(r3688481);
        double r3688483 = r3688480 + r3688482;
        double r3688484 = t;
        double r3688485 = r3688483 - r3688484;
        double r3688486 = a;
        double r3688487 = 0.5;
        double r3688488 = r3688486 - r3688487;
        double r3688489 = log(r3688484);
        double r3688490 = r3688488 * r3688489;
        double r3688491 = r3688485 + r3688490;
        return r3688491;
}

double f(double x, double y, double z, double t, double a) {
        double r3688492 = t;
        double r3688493 = log(r3688492);
        double r3688494 = a;
        double r3688495 = 0.5;
        double r3688496 = r3688494 - r3688495;
        double r3688497 = y;
        double r3688498 = x;
        double r3688499 = r3688497 + r3688498;
        double r3688500 = log(r3688499);
        double r3688501 = cbrt(r3688500);
        double r3688502 = r3688501 * r3688501;
        double r3688503 = z;
        double r3688504 = log(r3688503);
        double r3688505 = r3688504 - r3688492;
        double r3688506 = fma(r3688502, r3688501, r3688505);
        double r3688507 = fma(r3688493, r3688496, r3688506);
        return r3688507;
}

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. Simplified0.3

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

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

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

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

Reproduce

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