Average Error: 0.1 → 0.1
Time: 12.1s
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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r107478 = x;
        double r107479 = y;
        double r107480 = log(r107479);
        double r107481 = r107478 * r107480;
        double r107482 = z;
        double r107483 = r107481 + r107482;
        double r107484 = t;
        double r107485 = r107483 + r107484;
        double r107486 = a;
        double r107487 = r107485 + r107486;
        double r107488 = b;
        double r107489 = 0.5;
        double r107490 = r107488 - r107489;
        double r107491 = c;
        double r107492 = log(r107491);
        double r107493 = r107490 * r107492;
        double r107494 = r107487 + r107493;
        double r107495 = i;
        double r107496 = r107479 * r107495;
        double r107497 = r107494 + r107496;
        return r107497;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r107498 = i;
        double r107499 = y;
        double r107500 = c;
        double r107501 = log(r107500);
        double r107502 = b;
        double r107503 = 0.5;
        double r107504 = r107502 - r107503;
        double r107505 = x;
        double r107506 = log(r107499);
        double r107507 = z;
        double r107508 = fma(r107505, r107506, r107507);
        double r107509 = t;
        double r107510 = a;
        double r107511 = r107509 + r107510;
        double r107512 = r107508 + r107511;
        double r107513 = fma(r107501, r107504, r107512);
        double r107514 = fma(r107498, r107499, r107513);
        return r107514;
}

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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)}\]
  3. Final simplification0.1

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

Reproduce

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