Average Error: 0.1 → 0.5
Time: 38.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(y, i, a\right)\right) + \left(t + \left(\sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\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(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right) + \left(t + \left(\sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4379559 = x;
        double r4379560 = y;
        double r4379561 = log(r4379560);
        double r4379562 = r4379559 * r4379561;
        double r4379563 = z;
        double r4379564 = r4379562 + r4379563;
        double r4379565 = t;
        double r4379566 = r4379564 + r4379565;
        double r4379567 = a;
        double r4379568 = r4379566 + r4379567;
        double r4379569 = b;
        double r4379570 = 0.5;
        double r4379571 = r4379569 - r4379570;
        double r4379572 = c;
        double r4379573 = log(r4379572);
        double r4379574 = r4379571 * r4379573;
        double r4379575 = r4379568 + r4379574;
        double r4379576 = i;
        double r4379577 = r4379560 * r4379576;
        double r4379578 = r4379575 + r4379577;
        return r4379578;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4379579 = b;
        double r4379580 = 0.5;
        double r4379581 = r4379579 - r4379580;
        double r4379582 = c;
        double r4379583 = log(r4379582);
        double r4379584 = y;
        double r4379585 = i;
        double r4379586 = a;
        double r4379587 = fma(r4379584, r4379585, r4379586);
        double r4379588 = fma(r4379581, r4379583, r4379587);
        double r4379589 = t;
        double r4379590 = log(r4379584);
        double r4379591 = x;
        double r4379592 = z;
        double r4379593 = fma(r4379590, r4379591, r4379592);
        double r4379594 = cbrt(r4379593);
        double r4379595 = r4379594 * r4379594;
        double r4379596 = r4379595 * r4379594;
        double r4379597 = r4379589 + r4379596;
        double r4379598 = r4379588 + r4379597;
        return r4379598;
}

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, \mathsf{fma}\left(y, i, a\right)\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + t\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.5

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

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

Reproduce

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