Average Error: 0.1 → 0.1
Time: 41.7s
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(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\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(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r87179 = x;
        double r87180 = y;
        double r87181 = log(r87180);
        double r87182 = r87179 * r87181;
        double r87183 = z;
        double r87184 = r87182 + r87183;
        double r87185 = t;
        double r87186 = r87184 + r87185;
        double r87187 = a;
        double r87188 = r87186 + r87187;
        double r87189 = b;
        double r87190 = 0.5;
        double r87191 = r87189 - r87190;
        double r87192 = c;
        double r87193 = log(r87192);
        double r87194 = r87191 * r87193;
        double r87195 = r87188 + r87194;
        double r87196 = i;
        double r87197 = r87180 * r87196;
        double r87198 = r87195 + r87197;
        return r87198;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r87199 = y;
        double r87200 = i;
        double r87201 = c;
        double r87202 = log(r87201);
        double r87203 = b;
        double r87204 = 0.5;
        double r87205 = r87203 - r87204;
        double r87206 = a;
        double r87207 = x;
        double r87208 = log(r87199);
        double r87209 = z;
        double r87210 = fma(r87207, r87208, r87209);
        double r87211 = t;
        double r87212 = r87210 + r87211;
        double r87213 = r87206 + r87212;
        double r87214 = fma(r87202, r87205, r87213);
        double r87215 = fma(r87199, r87200, r87214);
        return r87215;
}

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

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

Reproduce

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