Average Error: 0.1 → 0.1
Time: 14.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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \left(x \cdot \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, \left(x \cdot \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 r67659 = x;
        double r67660 = y;
        double r67661 = log(r67660);
        double r67662 = r67659 * r67661;
        double r67663 = z;
        double r67664 = r67662 + r67663;
        double r67665 = t;
        double r67666 = r67664 + r67665;
        double r67667 = a;
        double r67668 = r67666 + r67667;
        double r67669 = b;
        double r67670 = 0.5;
        double r67671 = r67669 - r67670;
        double r67672 = c;
        double r67673 = log(r67672);
        double r67674 = r67671 * r67673;
        double r67675 = r67668 + r67674;
        double r67676 = i;
        double r67677 = r67660 * r67676;
        double r67678 = r67675 + r67677;
        return r67678;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r67679 = i;
        double r67680 = y;
        double r67681 = c;
        double r67682 = log(r67681);
        double r67683 = b;
        double r67684 = 0.5;
        double r67685 = r67683 - r67684;
        double r67686 = x;
        double r67687 = log(r67680);
        double r67688 = r67686 * r67687;
        double r67689 = z;
        double r67690 = r67688 + r67689;
        double r67691 = t;
        double r67692 = a;
        double r67693 = r67691 + r67692;
        double r67694 = r67690 + r67693;
        double r67695 = fma(r67682, r67685, r67694);
        double r67696 = fma(r67679, r67680, r67695);
        return r67696;
}

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. Using strategy rm
  4. Applied fma-udef0.1

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

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

Reproduce

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