Average Error: 0.3 → 0.3
Time: 44.5s
Precision: 64
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\]
\[\left(\left(\log \left(\sqrt[3]{z}\right) - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right) + \log \left(y + x\right)\right) + \log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\left(\left(\log \left(\sqrt[3]{z}\right) - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right) + \log \left(y + x\right)\right) + \log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)
double f(double x, double y, double z, double t, double a) {
        double r2916213 = x;
        double r2916214 = y;
        double r2916215 = r2916213 + r2916214;
        double r2916216 = log(r2916215);
        double r2916217 = z;
        double r2916218 = log(r2916217);
        double r2916219 = r2916216 + r2916218;
        double r2916220 = t;
        double r2916221 = r2916219 - r2916220;
        double r2916222 = a;
        double r2916223 = 0.5;
        double r2916224 = r2916222 - r2916223;
        double r2916225 = log(r2916220);
        double r2916226 = r2916224 * r2916225;
        double r2916227 = r2916221 + r2916226;
        return r2916227;
}

double f(double x, double y, double z, double t, double a) {
        double r2916228 = z;
        double r2916229 = cbrt(r2916228);
        double r2916230 = log(r2916229);
        double r2916231 = 0.5;
        double r2916232 = a;
        double r2916233 = r2916231 - r2916232;
        double r2916234 = t;
        double r2916235 = log(r2916234);
        double r2916236 = fma(r2916233, r2916235, r2916234);
        double r2916237 = r2916230 - r2916236;
        double r2916238 = y;
        double r2916239 = x;
        double r2916240 = r2916238 + r2916239;
        double r2916241 = log(r2916240);
        double r2916242 = r2916237 + r2916241;
        double r2916243 = r2916229 * r2916229;
        double r2916244 = log(r2916243);
        double r2916245 = r2916242 + r2916244;
        return r2916245;
}

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}{\left(\log z - \mathsf{fma}\left(0.5 - a, \log t, t\right)\right) + \log \left(y + x\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.3

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

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

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

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

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

Reproduce

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