Average Error: 0.1 → 0.1
Time: 25.7s
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, \mathsf{fma}\left(x, \log y, a + z\right) + t\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, \mathsf{fma}\left(x, \log y, a + z\right) + t\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r64109 = x;
        double r64110 = y;
        double r64111 = log(r64110);
        double r64112 = r64109 * r64111;
        double r64113 = z;
        double r64114 = r64112 + r64113;
        double r64115 = t;
        double r64116 = r64114 + r64115;
        double r64117 = a;
        double r64118 = r64116 + r64117;
        double r64119 = b;
        double r64120 = 0.5;
        double r64121 = r64119 - r64120;
        double r64122 = c;
        double r64123 = log(r64122);
        double r64124 = r64121 * r64123;
        double r64125 = r64118 + r64124;
        double r64126 = i;
        double r64127 = r64110 * r64126;
        double r64128 = r64125 + r64127;
        return r64128;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r64129 = y;
        double r64130 = i;
        double r64131 = c;
        double r64132 = log(r64131);
        double r64133 = b;
        double r64134 = 0.5;
        double r64135 = r64133 - r64134;
        double r64136 = x;
        double r64137 = log(r64129);
        double r64138 = a;
        double r64139 = z;
        double r64140 = r64138 + r64139;
        double r64141 = fma(r64136, r64137, r64140);
        double r64142 = t;
        double r64143 = r64141 + r64142;
        double r64144 = fma(r64132, r64135, r64143);
        double r64145 = fma(r64129, r64130, r64144);
        return r64145;
}

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. Using strategy rm
  4. Applied associate-+r+0.1

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

    \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \color{blue}{\mathsf{fma}\left(x, \log y, a + z\right)} + t\right)\right)\]
  6. Final simplification0.1

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

Reproduce

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