Average Error: 0.1 → 0.1
Time: 11.4s
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 r70621 = x;
        double r70622 = y;
        double r70623 = log(r70622);
        double r70624 = r70621 * r70623;
        double r70625 = z;
        double r70626 = r70624 + r70625;
        double r70627 = t;
        double r70628 = r70626 + r70627;
        double r70629 = a;
        double r70630 = r70628 + r70629;
        double r70631 = b;
        double r70632 = 0.5;
        double r70633 = r70631 - r70632;
        double r70634 = c;
        double r70635 = log(r70634);
        double r70636 = r70633 * r70635;
        double r70637 = r70630 + r70636;
        double r70638 = i;
        double r70639 = r70622 * r70638;
        double r70640 = r70637 + r70639;
        return r70640;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r70641 = i;
        double r70642 = y;
        double r70643 = c;
        double r70644 = log(r70643);
        double r70645 = b;
        double r70646 = 0.5;
        double r70647 = r70645 - r70646;
        double r70648 = x;
        double r70649 = log(r70642);
        double r70650 = z;
        double r70651 = fma(r70648, r70649, r70650);
        double r70652 = t;
        double r70653 = a;
        double r70654 = r70652 + r70653;
        double r70655 = r70651 + r70654;
        double r70656 = fma(r70644, r70647, r70655);
        double r70657 = fma(r70641, r70642, r70656);
        return r70657;
}

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