Average Error: 0.1 → 0.1
Time: 16.8s
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 r90928 = x;
        double r90929 = y;
        double r90930 = log(r90929);
        double r90931 = r90928 * r90930;
        double r90932 = z;
        double r90933 = r90931 + r90932;
        double r90934 = t;
        double r90935 = r90933 + r90934;
        double r90936 = a;
        double r90937 = r90935 + r90936;
        double r90938 = b;
        double r90939 = 0.5;
        double r90940 = r90938 - r90939;
        double r90941 = c;
        double r90942 = log(r90941);
        double r90943 = r90940 * r90942;
        double r90944 = r90937 + r90943;
        double r90945 = i;
        double r90946 = r90929 * r90945;
        double r90947 = r90944 + r90946;
        return r90947;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r90948 = i;
        double r90949 = y;
        double r90950 = c;
        double r90951 = log(r90950);
        double r90952 = b;
        double r90953 = 0.5;
        double r90954 = r90952 - r90953;
        double r90955 = x;
        double r90956 = log(r90949);
        double r90957 = z;
        double r90958 = fma(r90955, r90956, r90957);
        double r90959 = t;
        double r90960 = a;
        double r90961 = r90959 + r90960;
        double r90962 = r90958 + r90961;
        double r90963 = fma(r90951, r90954, r90962);
        double r90964 = fma(r90948, r90949, r90963);
        return r90964;
}

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