Average Error: 0.1 → 0.1
Time: 26.8s
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, z\right) + \mathsf{fma}\left(y, i, \mathsf{fma}\left(x, \log y, t\right) + 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, z\right) + \mathsf{fma}\left(y, i, \mathsf{fma}\left(x, \log y, t\right) + a\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r1334370 = x;
        double r1334371 = y;
        double r1334372 = log(r1334371);
        double r1334373 = r1334370 * r1334372;
        double r1334374 = z;
        double r1334375 = r1334373 + r1334374;
        double r1334376 = t;
        double r1334377 = r1334375 + r1334376;
        double r1334378 = a;
        double r1334379 = r1334377 + r1334378;
        double r1334380 = b;
        double r1334381 = 0.5;
        double r1334382 = r1334380 - r1334381;
        double r1334383 = c;
        double r1334384 = log(r1334383);
        double r1334385 = r1334382 * r1334384;
        double r1334386 = r1334379 + r1334385;
        double r1334387 = i;
        double r1334388 = r1334371 * r1334387;
        double r1334389 = r1334386 + r1334388;
        return r1334389;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r1334390 = b;
        double r1334391 = 0.5;
        double r1334392 = r1334390 - r1334391;
        double r1334393 = c;
        double r1334394 = log(r1334393);
        double r1334395 = z;
        double r1334396 = fma(r1334392, r1334394, r1334395);
        double r1334397 = y;
        double r1334398 = i;
        double r1334399 = x;
        double r1334400 = log(r1334397);
        double r1334401 = t;
        double r1334402 = fma(r1334399, r1334400, r1334401);
        double r1334403 = a;
        double r1334404 = r1334402 + r1334403;
        double r1334405 = fma(r1334397, r1334398, r1334404);
        double r1334406 = r1334396 + r1334405;
        return r1334406;
}

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

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

Reproduce

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