Average Error: 0.1 → 0.1
Time: 13.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 r65012 = x;
        double r65013 = y;
        double r65014 = log(r65013);
        double r65015 = r65012 * r65014;
        double r65016 = z;
        double r65017 = r65015 + r65016;
        double r65018 = t;
        double r65019 = r65017 + r65018;
        double r65020 = a;
        double r65021 = r65019 + r65020;
        double r65022 = b;
        double r65023 = 0.5;
        double r65024 = r65022 - r65023;
        double r65025 = c;
        double r65026 = log(r65025);
        double r65027 = r65024 * r65026;
        double r65028 = r65021 + r65027;
        double r65029 = i;
        double r65030 = r65013 * r65029;
        double r65031 = r65028 + r65030;
        return r65031;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r65032 = y;
        double r65033 = i;
        double r65034 = c;
        double r65035 = log(r65034);
        double r65036 = b;
        double r65037 = 0.5;
        double r65038 = r65036 - r65037;
        double r65039 = a;
        double r65040 = x;
        double r65041 = log(r65032);
        double r65042 = z;
        double r65043 = fma(r65040, r65041, r65042);
        double r65044 = t;
        double r65045 = r65043 + r65044;
        double r65046 = r65039 + r65045;
        double r65047 = fma(r65035, r65038, r65046);
        double r65048 = fma(r65032, r65033, r65047);
        return r65048;
}

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