Average Error: 0.1 → 0.5
Time: 1.2m
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(\sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\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(\sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r1648270 = x;
        double r1648271 = y;
        double r1648272 = log(r1648271);
        double r1648273 = r1648270 * r1648272;
        double r1648274 = z;
        double r1648275 = r1648273 + r1648274;
        double r1648276 = t;
        double r1648277 = r1648275 + r1648276;
        double r1648278 = a;
        double r1648279 = r1648277 + r1648278;
        double r1648280 = b;
        double r1648281 = 0.5;
        double r1648282 = r1648280 - r1648281;
        double r1648283 = c;
        double r1648284 = log(r1648283);
        double r1648285 = r1648282 * r1648284;
        double r1648286 = r1648279 + r1648285;
        double r1648287 = i;
        double r1648288 = r1648271 * r1648287;
        double r1648289 = r1648286 + r1648288;
        return r1648289;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r1648290 = y;
        double r1648291 = log(r1648290);
        double r1648292 = x;
        double r1648293 = z;
        double r1648294 = fma(r1648291, r1648292, r1648293);
        double r1648295 = cbrt(r1648294);
        double r1648296 = r1648295 * r1648295;
        double r1648297 = t;
        double r1648298 = fma(r1648296, r1648295, r1648297);
        double r1648299 = b;
        double r1648300 = 0.5;
        double r1648301 = r1648299 - r1648300;
        double r1648302 = c;
        double r1648303 = log(r1648302);
        double r1648304 = i;
        double r1648305 = a;
        double r1648306 = fma(r1648290, r1648304, r1648305);
        double r1648307 = fma(r1648301, r1648303, r1648306);
        double r1648308 = r1648298 + r1648307;
        return r1648308;
}

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 add-cube-cbrt0.5

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

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

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

Reproduce

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