Average Error: 0.1 → 0.1
Time: 38.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(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right) + \mathsf{fma}\left(\log y, x, a\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(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right) + \mathsf{fma}\left(\log y, x, a\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3554568 = x;
        double r3554569 = y;
        double r3554570 = log(r3554569);
        double r3554571 = r3554568 * r3554570;
        double r3554572 = z;
        double r3554573 = r3554571 + r3554572;
        double r3554574 = t;
        double r3554575 = r3554573 + r3554574;
        double r3554576 = a;
        double r3554577 = r3554575 + r3554576;
        double r3554578 = b;
        double r3554579 = 0.5;
        double r3554580 = r3554578 - r3554579;
        double r3554581 = c;
        double r3554582 = log(r3554581);
        double r3554583 = r3554580 * r3554582;
        double r3554584 = r3554577 + r3554583;
        double r3554585 = i;
        double r3554586 = r3554569 * r3554585;
        double r3554587 = r3554584 + r3554586;
        return r3554587;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3554588 = b;
        double r3554589 = 0.5;
        double r3554590 = r3554588 - r3554589;
        double r3554591 = c;
        double r3554592 = log(r3554591);
        double r3554593 = i;
        double r3554594 = y;
        double r3554595 = z;
        double r3554596 = t;
        double r3554597 = r3554595 + r3554596;
        double r3554598 = fma(r3554593, r3554594, r3554597);
        double r3554599 = fma(r3554590, r3554592, r3554598);
        double r3554600 = log(r3554594);
        double r3554601 = x;
        double r3554602 = a;
        double r3554603 = fma(r3554600, r3554601, r3554602);
        double r3554604 = r3554599 + r3554603;
        return r3554604;
}

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, t + z\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, a\right)\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

    \[\leadsto \mathsf{fma}\left(i, y, t + z\right) + \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \mathsf{fma}\left(\log y, x, a\right)\right)}\]
  5. Applied associate-+r+0.1

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

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

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

Reproduce

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