Average Error: 0.1 → 0.1
Time: 23.6s
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 r91152 = x;
        double r91153 = y;
        double r91154 = log(r91153);
        double r91155 = r91152 * r91154;
        double r91156 = z;
        double r91157 = r91155 + r91156;
        double r91158 = t;
        double r91159 = r91157 + r91158;
        double r91160 = a;
        double r91161 = r91159 + r91160;
        double r91162 = b;
        double r91163 = 0.5;
        double r91164 = r91162 - r91163;
        double r91165 = c;
        double r91166 = log(r91165);
        double r91167 = r91164 * r91166;
        double r91168 = r91161 + r91167;
        double r91169 = i;
        double r91170 = r91153 * r91169;
        double r91171 = r91168 + r91170;
        return r91171;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r91172 = y;
        double r91173 = i;
        double r91174 = c;
        double r91175 = log(r91174);
        double r91176 = b;
        double r91177 = 0.5;
        double r91178 = r91176 - r91177;
        double r91179 = a;
        double r91180 = x;
        double r91181 = log(r91172);
        double r91182 = z;
        double r91183 = fma(r91180, r91181, r91182);
        double r91184 = t;
        double r91185 = r91183 + r91184;
        double r91186 = r91179 + r91185;
        double r91187 = fma(r91175, r91178, r91186);
        double r91188 = fma(r91172, r91173, r91187);
        return r91188;
}

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