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(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 r106447 = x;
        double r106448 = y;
        double r106449 = log(r106448);
        double r106450 = r106447 * r106449;
        double r106451 = z;
        double r106452 = r106450 + r106451;
        double r106453 = t;
        double r106454 = r106452 + r106453;
        double r106455 = a;
        double r106456 = r106454 + r106455;
        double r106457 = b;
        double r106458 = 0.5;
        double r106459 = r106457 - r106458;
        double r106460 = c;
        double r106461 = log(r106460);
        double r106462 = r106459 * r106461;
        double r106463 = r106456 + r106462;
        double r106464 = i;
        double r106465 = r106448 * r106464;
        double r106466 = r106463 + r106465;
        return r106466;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r106467 = y;
        double r106468 = i;
        double r106469 = c;
        double r106470 = log(r106469);
        double r106471 = b;
        double r106472 = 0.5;
        double r106473 = r106471 - r106472;
        double r106474 = a;
        double r106475 = x;
        double r106476 = log(r106467);
        double r106477 = z;
        double r106478 = fma(r106475, r106476, r106477);
        double r106479 = t;
        double r106480 = r106478 + r106479;
        double r106481 = r106474 + r106480;
        double r106482 = fma(r106470, r106473, r106481);
        double r106483 = fma(r106467, r106468, r106482);
        return r106483;
}

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