Average Error: 0.1 → 0.1
Time: 41.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\]
\[\left(\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, a\right)\right)\right) + z\right) + t\]
\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
\left(\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, a\right)\right)\right) + z\right) + t
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4247138 = x;
        double r4247139 = y;
        double r4247140 = log(r4247139);
        double r4247141 = r4247138 * r4247140;
        double r4247142 = z;
        double r4247143 = r4247141 + r4247142;
        double r4247144 = t;
        double r4247145 = r4247143 + r4247144;
        double r4247146 = a;
        double r4247147 = r4247145 + r4247146;
        double r4247148 = b;
        double r4247149 = 0.5;
        double r4247150 = r4247148 - r4247149;
        double r4247151 = c;
        double r4247152 = log(r4247151);
        double r4247153 = r4247150 * r4247152;
        double r4247154 = r4247147 + r4247153;
        double r4247155 = i;
        double r4247156 = r4247139 * r4247155;
        double r4247157 = r4247154 + r4247156;
        return r4247157;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4247158 = y;
        double r4247159 = log(r4247158);
        double r4247160 = x;
        double r4247161 = b;
        double r4247162 = 0.5;
        double r4247163 = r4247161 - r4247162;
        double r4247164 = c;
        double r4247165 = log(r4247164);
        double r4247166 = i;
        double r4247167 = a;
        double r4247168 = fma(r4247166, r4247158, r4247167);
        double r4247169 = fma(r4247163, r4247165, r4247168);
        double r4247170 = fma(r4247159, r4247160, r4247169);
        double r4247171 = z;
        double r4247172 = r4247170 + r4247171;
        double r4247173 = t;
        double r4247174 = r4247172 + r4247173;
        return r4247174;
}

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(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + t\right)}\]
  3. Using strategy rm
  4. Applied associate-+r+0.1

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

    \[\leadsto \left(\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right) + \color{blue}{\left(\log y \cdot x + z\right)}\right) + t\]
  7. Applied associate-+r+0.1

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

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

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

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
  (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))