Average Error: 0.1 → 0.1
Time: 9.9s
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 r78910 = x;
        double r78911 = y;
        double r78912 = log(r78911);
        double r78913 = r78910 * r78912;
        double r78914 = z;
        double r78915 = r78913 + r78914;
        double r78916 = t;
        double r78917 = r78915 + r78916;
        double r78918 = a;
        double r78919 = r78917 + r78918;
        double r78920 = b;
        double r78921 = 0.5;
        double r78922 = r78920 - r78921;
        double r78923 = c;
        double r78924 = log(r78923);
        double r78925 = r78922 * r78924;
        double r78926 = r78919 + r78925;
        double r78927 = i;
        double r78928 = r78911 * r78927;
        double r78929 = r78926 + r78928;
        return r78929;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r78930 = i;
        double r78931 = y;
        double r78932 = c;
        double r78933 = log(r78932);
        double r78934 = b;
        double r78935 = 0.5;
        double r78936 = r78934 - r78935;
        double r78937 = x;
        double r78938 = log(r78931);
        double r78939 = z;
        double r78940 = fma(r78937, r78938, r78939);
        double r78941 = t;
        double r78942 = a;
        double r78943 = r78941 + r78942;
        double r78944 = r78940 + r78943;
        double r78945 = fma(r78933, r78936, r78944);
        double r78946 = fma(r78930, r78931, r78945);
        return r78946;
}

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