Average Error: 0.1 → 0.1
Time: 50.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\]
\[\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right) + \mathsf{fma}\left(\log y, x, a\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(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right) + \mathsf{fma}\left(\log y, x, a\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r158261 = x;
        double r158262 = y;
        double r158263 = log(r158262);
        double r158264 = r158261 * r158263;
        double r158265 = z;
        double r158266 = r158264 + r158265;
        double r158267 = t;
        double r158268 = r158266 + r158267;
        double r158269 = a;
        double r158270 = r158268 + r158269;
        double r158271 = b;
        double r158272 = 0.5;
        double r158273 = r158271 - r158272;
        double r158274 = c;
        double r158275 = log(r158274);
        double r158276 = r158273 * r158275;
        double r158277 = r158270 + r158276;
        double r158278 = i;
        double r158279 = r158262 * r158278;
        double r158280 = r158277 + r158279;
        return r158280;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r158281 = b;
        double r158282 = 0.5;
        double r158283 = r158281 - r158282;
        double r158284 = c;
        double r158285 = log(r158284);
        double r158286 = i;
        double r158287 = y;
        double r158288 = z;
        double r158289 = t;
        double r158290 = r158288 + r158289;
        double r158291 = fma(r158286, r158287, r158290);
        double r158292 = fma(r158283, r158285, r158291);
        double r158293 = log(r158287);
        double r158294 = x;
        double r158295 = a;
        double r158296 = fma(r158293, r158294, r158295);
        double r158297 = r158292 + r158296;
        return r158297;
}

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

    \[\leadsto \mathsf{fma}\left(i, y, t + z\right) + \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \mathsf{fma}\left(\log y, x, a\right)\right)}\]
  5. Applied associate-+r+0.1

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

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

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

Reproduce

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