Average Error: 0.1 → 0.1
Time: 42.8s
Precision: 64
\[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\]
\[\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\right)\right)\right)\]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r103390 = x;
        double r103391 = y;
        double r103392 = log(r103391);
        double r103393 = r103390 * r103392;
        double r103394 = z;
        double r103395 = r103393 + r103394;
        double r103396 = t;
        double r103397 = r103395 + r103396;
        double r103398 = a;
        double r103399 = r103397 + r103398;
        double r103400 = b;
        double r103401 = 0.5;
        double r103402 = r103400 - r103401;
        double r103403 = c;
        double r103404 = log(r103403);
        double r103405 = r103402 * r103404;
        double r103406 = r103399 + r103405;
        double r103407 = i;
        double r103408 = r103391 * r103407;
        double r103409 = r103406 + r103408;
        return r103409;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r103410 = y;
        double r103411 = i;
        double r103412 = c;
        double r103413 = log(r103412);
        double r103414 = b;
        double r103415 = 0.5;
        double r103416 = r103414 - r103415;
        double r103417 = a;
        double r103418 = x;
        double r103419 = log(r103410);
        double r103420 = z;
        double r103421 = fma(r103418, r103419, r103420);
        double r103422 = t;
        double r103423 = r103421 + r103422;
        double r103424 = r103417 + r103423;
        double r103425 = fma(r103413, r103416, r103424);
        double r103426 = fma(r103410, r103411, r103425);
        return r103426;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\]
  2. Simplified0.1

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

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

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
  :precision binary64
  (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))