Average Error: 0.1 → 0.1
Time: 31.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 r102364 = x;
        double r102365 = y;
        double r102366 = log(r102365);
        double r102367 = r102364 * r102366;
        double r102368 = z;
        double r102369 = r102367 + r102368;
        double r102370 = t;
        double r102371 = r102369 + r102370;
        double r102372 = a;
        double r102373 = r102371 + r102372;
        double r102374 = b;
        double r102375 = 0.5;
        double r102376 = r102374 - r102375;
        double r102377 = c;
        double r102378 = log(r102377);
        double r102379 = r102376 * r102378;
        double r102380 = r102373 + r102379;
        double r102381 = i;
        double r102382 = r102365 * r102381;
        double r102383 = r102380 + r102382;
        return r102383;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r102384 = y;
        double r102385 = i;
        double r102386 = c;
        double r102387 = log(r102386);
        double r102388 = b;
        double r102389 = 0.5;
        double r102390 = r102388 - r102389;
        double r102391 = a;
        double r102392 = x;
        double r102393 = log(r102384);
        double r102394 = z;
        double r102395 = fma(r102392, r102393, r102394);
        double r102396 = t;
        double r102397 = r102395 + r102396;
        double r102398 = r102391 + r102397;
        double r102399 = fma(r102387, r102390, r102398);
        double r102400 = fma(r102384, r102385, r102399);
        return r102400;
}

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