Average Error: 0.1 → 0.1
Time: 18.1s
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 r100030 = x;
        double r100031 = y;
        double r100032 = log(r100031);
        double r100033 = r100030 * r100032;
        double r100034 = z;
        double r100035 = r100033 + r100034;
        double r100036 = t;
        double r100037 = r100035 + r100036;
        double r100038 = a;
        double r100039 = r100037 + r100038;
        double r100040 = b;
        double r100041 = 0.5;
        double r100042 = r100040 - r100041;
        double r100043 = c;
        double r100044 = log(r100043);
        double r100045 = r100042 * r100044;
        double r100046 = r100039 + r100045;
        double r100047 = i;
        double r100048 = r100031 * r100047;
        double r100049 = r100046 + r100048;
        return r100049;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r100050 = i;
        double r100051 = y;
        double r100052 = c;
        double r100053 = log(r100052);
        double r100054 = b;
        double r100055 = 0.5;
        double r100056 = r100054 - r100055;
        double r100057 = x;
        double r100058 = log(r100051);
        double r100059 = z;
        double r100060 = fma(r100057, r100058, r100059);
        double r100061 = t;
        double r100062 = a;
        double r100063 = r100061 + r100062;
        double r100064 = r100060 + r100063;
        double r100065 = fma(r100053, r100056, r100064);
        double r100066 = fma(r100050, r100051, r100065);
        return r100066;
}

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