Average Error: 0.1 → 0.1
Time: 39.3s
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\]
\[\left(t + \mathsf{fma}\left(\log y, x, z\right)\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\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
\left(t + \mathsf{fma}\left(\log y, x, z\right)\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3644918 = x;
        double r3644919 = y;
        double r3644920 = log(r3644919);
        double r3644921 = r3644918 * r3644920;
        double r3644922 = z;
        double r3644923 = r3644921 + r3644922;
        double r3644924 = t;
        double r3644925 = r3644923 + r3644924;
        double r3644926 = a;
        double r3644927 = r3644925 + r3644926;
        double r3644928 = b;
        double r3644929 = 0.5;
        double r3644930 = r3644928 - r3644929;
        double r3644931 = c;
        double r3644932 = log(r3644931);
        double r3644933 = r3644930 * r3644932;
        double r3644934 = r3644927 + r3644933;
        double r3644935 = i;
        double r3644936 = r3644919 * r3644935;
        double r3644937 = r3644934 + r3644936;
        return r3644937;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3644938 = t;
        double r3644939 = y;
        double r3644940 = log(r3644939);
        double r3644941 = x;
        double r3644942 = z;
        double r3644943 = fma(r3644940, r3644941, r3644942);
        double r3644944 = r3644938 + r3644943;
        double r3644945 = b;
        double r3644946 = 0.5;
        double r3644947 = r3644945 - r3644946;
        double r3644948 = c;
        double r3644949 = log(r3644948);
        double r3644950 = i;
        double r3644951 = a;
        double r3644952 = fma(r3644939, r3644950, r3644951);
        double r3644953 = fma(r3644947, r3644949, r3644952);
        double r3644954 = r3644944 + r3644953;
        return r3644954;
}

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

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

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

Reproduce

herbie shell --seed 2019172 +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)))