Average Error: 0.1 → 0.1
Time: 19.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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r119114 = x;
        double r119115 = y;
        double r119116 = log(r119115);
        double r119117 = r119114 * r119116;
        double r119118 = z;
        double r119119 = r119117 + r119118;
        double r119120 = t;
        double r119121 = r119119 + r119120;
        double r119122 = a;
        double r119123 = r119121 + r119122;
        double r119124 = b;
        double r119125 = 0.5;
        double r119126 = r119124 - r119125;
        double r119127 = c;
        double r119128 = log(r119127);
        double r119129 = r119126 * r119128;
        double r119130 = r119123 + r119129;
        double r119131 = i;
        double r119132 = r119115 * r119131;
        double r119133 = r119130 + r119132;
        return r119133;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r119134 = i;
        double r119135 = y;
        double r119136 = c;
        double r119137 = log(r119136);
        double r119138 = b;
        double r119139 = 0.5;
        double r119140 = r119138 - r119139;
        double r119141 = x;
        double r119142 = log(r119135);
        double r119143 = z;
        double r119144 = fma(r119141, r119142, r119143);
        double r119145 = t;
        double r119146 = a;
        double r119147 = r119145 + r119146;
        double r119148 = r119144 + r119147;
        double r119149 = fma(r119137, r119140, r119148);
        double r119150 = fma(r119134, r119135, r119149);
        return r119150;
}

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

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

Reproduce

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