Average Error: 0.1 → 0.1
Time: 39.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(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 r69161 = x;
        double r69162 = y;
        double r69163 = log(r69162);
        double r69164 = r69161 * r69163;
        double r69165 = z;
        double r69166 = r69164 + r69165;
        double r69167 = t;
        double r69168 = r69166 + r69167;
        double r69169 = a;
        double r69170 = r69168 + r69169;
        double r69171 = b;
        double r69172 = 0.5;
        double r69173 = r69171 - r69172;
        double r69174 = c;
        double r69175 = log(r69174);
        double r69176 = r69173 * r69175;
        double r69177 = r69170 + r69176;
        double r69178 = i;
        double r69179 = r69162 * r69178;
        double r69180 = r69177 + r69179;
        return r69180;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r69181 = y;
        double r69182 = i;
        double r69183 = c;
        double r69184 = log(r69183);
        double r69185 = b;
        double r69186 = 0.5;
        double r69187 = r69185 - r69186;
        double r69188 = a;
        double r69189 = x;
        double r69190 = log(r69181);
        double r69191 = z;
        double r69192 = fma(r69189, r69190, r69191);
        double r69193 = t;
        double r69194 = r69192 + r69193;
        double r69195 = r69188 + r69194;
        double r69196 = fma(r69184, r69187, r69195);
        double r69197 = fma(r69181, r69182, r69196);
        return r69197;
}

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