Average Error: 0.1 → 0.1
Time: 12.2s
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 r78969 = x;
        double r78970 = y;
        double r78971 = log(r78970);
        double r78972 = r78969 * r78971;
        double r78973 = z;
        double r78974 = r78972 + r78973;
        double r78975 = t;
        double r78976 = r78974 + r78975;
        double r78977 = a;
        double r78978 = r78976 + r78977;
        double r78979 = b;
        double r78980 = 0.5;
        double r78981 = r78979 - r78980;
        double r78982 = c;
        double r78983 = log(r78982);
        double r78984 = r78981 * r78983;
        double r78985 = r78978 + r78984;
        double r78986 = i;
        double r78987 = r78970 * r78986;
        double r78988 = r78985 + r78987;
        return r78988;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r78989 = i;
        double r78990 = y;
        double r78991 = c;
        double r78992 = log(r78991);
        double r78993 = b;
        double r78994 = 0.5;
        double r78995 = r78993 - r78994;
        double r78996 = x;
        double r78997 = log(r78990);
        double r78998 = z;
        double r78999 = fma(r78996, r78997, r78998);
        double r79000 = t;
        double r79001 = a;
        double r79002 = r79000 + r79001;
        double r79003 = r78999 + r79002;
        double r79004 = fma(r78992, r78995, r79003);
        double r79005 = fma(r78989, r78990, r79004);
        return r79005;
}

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