Average Error: 0.1 → 0.1
Time: 26.3s
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(z + \mathsf{fma}\left(\log y, x, t\right)\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(z + \mathsf{fma}\left(\log y, x, t\right)\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61523 = x;
        double r61524 = y;
        double r61525 = log(r61524);
        double r61526 = r61523 * r61525;
        double r61527 = z;
        double r61528 = r61526 + r61527;
        double r61529 = t;
        double r61530 = r61528 + r61529;
        double r61531 = a;
        double r61532 = r61530 + r61531;
        double r61533 = b;
        double r61534 = 0.5;
        double r61535 = r61533 - r61534;
        double r61536 = c;
        double r61537 = log(r61536);
        double r61538 = r61535 * r61537;
        double r61539 = r61532 + r61538;
        double r61540 = i;
        double r61541 = r61524 * r61540;
        double r61542 = r61539 + r61541;
        return r61542;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61543 = y;
        double r61544 = i;
        double r61545 = c;
        double r61546 = log(r61545);
        double r61547 = b;
        double r61548 = 0.5;
        double r61549 = r61547 - r61548;
        double r61550 = a;
        double r61551 = z;
        double r61552 = log(r61543);
        double r61553 = x;
        double r61554 = t;
        double r61555 = fma(r61552, r61553, r61554);
        double r61556 = r61551 + r61555;
        double r61557 = r61550 + r61556;
        double r61558 = fma(r61546, r61549, r61557);
        double r61559 = fma(r61543, r61544, r61558);
        return r61559;
}

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. Taylor expanded around 0 0.1

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

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

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

Reproduce

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