Average Error: 0.1 → 0.1
Time: 52.0s
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 r107534 = x;
        double r107535 = y;
        double r107536 = log(r107535);
        double r107537 = r107534 * r107536;
        double r107538 = z;
        double r107539 = r107537 + r107538;
        double r107540 = t;
        double r107541 = r107539 + r107540;
        double r107542 = a;
        double r107543 = r107541 + r107542;
        double r107544 = b;
        double r107545 = 0.5;
        double r107546 = r107544 - r107545;
        double r107547 = c;
        double r107548 = log(r107547);
        double r107549 = r107546 * r107548;
        double r107550 = r107543 + r107549;
        double r107551 = i;
        double r107552 = r107535 * r107551;
        double r107553 = r107550 + r107552;
        return r107553;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r107554 = y;
        double r107555 = i;
        double r107556 = c;
        double r107557 = log(r107556);
        double r107558 = b;
        double r107559 = 0.5;
        double r107560 = r107558 - r107559;
        double r107561 = a;
        double r107562 = x;
        double r107563 = log(r107554);
        double r107564 = z;
        double r107565 = fma(r107562, r107563, r107564);
        double r107566 = t;
        double r107567 = r107565 + r107566;
        double r107568 = r107561 + r107567;
        double r107569 = fma(r107557, r107560, r107568);
        double r107570 = fma(r107554, r107555, r107569);
        return r107570;
}

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