Average Error: 0.1 → 0.1
Time: 49.9s
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 r108145 = x;
        double r108146 = y;
        double r108147 = log(r108146);
        double r108148 = r108145 * r108147;
        double r108149 = z;
        double r108150 = r108148 + r108149;
        double r108151 = t;
        double r108152 = r108150 + r108151;
        double r108153 = a;
        double r108154 = r108152 + r108153;
        double r108155 = b;
        double r108156 = 0.5;
        double r108157 = r108155 - r108156;
        double r108158 = c;
        double r108159 = log(r108158);
        double r108160 = r108157 * r108159;
        double r108161 = r108154 + r108160;
        double r108162 = i;
        double r108163 = r108146 * r108162;
        double r108164 = r108161 + r108163;
        return r108164;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r108165 = y;
        double r108166 = i;
        double r108167 = c;
        double r108168 = log(r108167);
        double r108169 = b;
        double r108170 = 0.5;
        double r108171 = r108169 - r108170;
        double r108172 = a;
        double r108173 = x;
        double r108174 = log(r108165);
        double r108175 = z;
        double r108176 = fma(r108173, r108174, r108175);
        double r108177 = t;
        double r108178 = r108176 + r108177;
        double r108179 = r108172 + r108178;
        double r108180 = fma(r108168, r108171, r108179);
        double r108181 = fma(r108165, r108166, r108180);
        return r108181;
}

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