Average Error: 0.1 → 0.1
Time: 21.5s
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 r110267 = x;
        double r110268 = y;
        double r110269 = log(r110268);
        double r110270 = r110267 * r110269;
        double r110271 = z;
        double r110272 = r110270 + r110271;
        double r110273 = t;
        double r110274 = r110272 + r110273;
        double r110275 = a;
        double r110276 = r110274 + r110275;
        double r110277 = b;
        double r110278 = 0.5;
        double r110279 = r110277 - r110278;
        double r110280 = c;
        double r110281 = log(r110280);
        double r110282 = r110279 * r110281;
        double r110283 = r110276 + r110282;
        double r110284 = i;
        double r110285 = r110268 * r110284;
        double r110286 = r110283 + r110285;
        return r110286;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r110287 = y;
        double r110288 = i;
        double r110289 = c;
        double r110290 = log(r110289);
        double r110291 = b;
        double r110292 = 0.5;
        double r110293 = r110291 - r110292;
        double r110294 = a;
        double r110295 = x;
        double r110296 = log(r110287);
        double r110297 = z;
        double r110298 = fma(r110295, r110296, r110297);
        double r110299 = t;
        double r110300 = r110298 + r110299;
        double r110301 = r110294 + r110300;
        double r110302 = fma(r110290, r110293, r110301);
        double r110303 = fma(r110287, r110288, r110302);
        return r110303;
}

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 2020046 +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)))