Average Error: 0.1 → 0.1
Time: 30.6s
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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r166355 = x;
        double r166356 = y;
        double r166357 = log(r166356);
        double r166358 = r166355 * r166357;
        double r166359 = z;
        double r166360 = r166358 + r166359;
        double r166361 = t;
        double r166362 = r166360 + r166361;
        double r166363 = a;
        double r166364 = r166362 + r166363;
        double r166365 = b;
        double r166366 = 0.5;
        double r166367 = r166365 - r166366;
        double r166368 = c;
        double r166369 = log(r166368);
        double r166370 = r166367 * r166369;
        double r166371 = r166364 + r166370;
        double r166372 = i;
        double r166373 = r166356 * r166372;
        double r166374 = r166371 + r166373;
        return r166374;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r166375 = i;
        double r166376 = y;
        double r166377 = c;
        double r166378 = log(r166377);
        double r166379 = b;
        double r166380 = 0.5;
        double r166381 = r166379 - r166380;
        double r166382 = x;
        double r166383 = log(r166376);
        double r166384 = z;
        double r166385 = fma(r166382, r166383, r166384);
        double r166386 = t;
        double r166387 = a;
        double r166388 = r166386 + r166387;
        double r166389 = r166385 + r166388;
        double r166390 = fma(r166378, r166381, r166389);
        double r166391 = fma(r166375, r166376, r166390);
        return r166391;
}

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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)}\]
  3. Final simplification0.1

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

Reproduce

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