Average Error: 0.1 → 0.1
Time: 40.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(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, a\right)\right) + \mathsf{fma}\left(i, y, z + t\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(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, a\right)\right) + \mathsf{fma}\left(i, y, z + t\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4419612 = x;
        double r4419613 = y;
        double r4419614 = log(r4419613);
        double r4419615 = r4419612 * r4419614;
        double r4419616 = z;
        double r4419617 = r4419615 + r4419616;
        double r4419618 = t;
        double r4419619 = r4419617 + r4419618;
        double r4419620 = a;
        double r4419621 = r4419619 + r4419620;
        double r4419622 = b;
        double r4419623 = 0.5;
        double r4419624 = r4419622 - r4419623;
        double r4419625 = c;
        double r4419626 = log(r4419625);
        double r4419627 = r4419624 * r4419626;
        double r4419628 = r4419621 + r4419627;
        double r4419629 = i;
        double r4419630 = r4419613 * r4419629;
        double r4419631 = r4419628 + r4419630;
        return r4419631;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4419632 = b;
        double r4419633 = 0.5;
        double r4419634 = r4419632 - r4419633;
        double r4419635 = c;
        double r4419636 = log(r4419635);
        double r4419637 = y;
        double r4419638 = log(r4419637);
        double r4419639 = x;
        double r4419640 = a;
        double r4419641 = fma(r4419638, r4419639, r4419640);
        double r4419642 = fma(r4419634, r4419636, r4419641);
        double r4419643 = i;
        double r4419644 = z;
        double r4419645 = t;
        double r4419646 = r4419644 + r4419645;
        double r4419647 = fma(r4419643, r4419637, r4419646);
        double r4419648 = r4419642 + r4419647;
        return r4419648;
}

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

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

Reproduce

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