Average Error: 0.1 → 0.1
Time: 15.0s
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 r83577 = x;
        double r83578 = y;
        double r83579 = log(r83578);
        double r83580 = r83577 * r83579;
        double r83581 = z;
        double r83582 = r83580 + r83581;
        double r83583 = t;
        double r83584 = r83582 + r83583;
        double r83585 = a;
        double r83586 = r83584 + r83585;
        double r83587 = b;
        double r83588 = 0.5;
        double r83589 = r83587 - r83588;
        double r83590 = c;
        double r83591 = log(r83590);
        double r83592 = r83589 * r83591;
        double r83593 = r83586 + r83592;
        double r83594 = i;
        double r83595 = r83578 * r83594;
        double r83596 = r83593 + r83595;
        return r83596;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r83597 = y;
        double r83598 = i;
        double r83599 = c;
        double r83600 = log(r83599);
        double r83601 = b;
        double r83602 = 0.5;
        double r83603 = r83601 - r83602;
        double r83604 = a;
        double r83605 = x;
        double r83606 = log(r83597);
        double r83607 = z;
        double r83608 = fma(r83605, r83606, r83607);
        double r83609 = t;
        double r83610 = r83608 + r83609;
        double r83611 = r83604 + r83610;
        double r83612 = fma(r83600, r83603, r83611);
        double r83613 = fma(r83597, r83598, r83612);
        return r83613;
}

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