Average Error: 0.1 → 0.1
Time: 35.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(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + 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(y, i, a\right)\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + t\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3617184 = x;
        double r3617185 = y;
        double r3617186 = log(r3617185);
        double r3617187 = r3617184 * r3617186;
        double r3617188 = z;
        double r3617189 = r3617187 + r3617188;
        double r3617190 = t;
        double r3617191 = r3617189 + r3617190;
        double r3617192 = a;
        double r3617193 = r3617191 + r3617192;
        double r3617194 = b;
        double r3617195 = 0.5;
        double r3617196 = r3617194 - r3617195;
        double r3617197 = c;
        double r3617198 = log(r3617197);
        double r3617199 = r3617196 * r3617198;
        double r3617200 = r3617193 + r3617199;
        double r3617201 = i;
        double r3617202 = r3617185 * r3617201;
        double r3617203 = r3617200 + r3617202;
        return r3617203;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3617204 = b;
        double r3617205 = 0.5;
        double r3617206 = r3617204 - r3617205;
        double r3617207 = c;
        double r3617208 = log(r3617207);
        double r3617209 = y;
        double r3617210 = i;
        double r3617211 = a;
        double r3617212 = fma(r3617209, r3617210, r3617211);
        double r3617213 = fma(r3617206, r3617208, r3617212);
        double r3617214 = log(r3617209);
        double r3617215 = x;
        double r3617216 = z;
        double r3617217 = fma(r3617214, r3617215, r3617216);
        double r3617218 = t;
        double r3617219 = r3617217 + r3617218;
        double r3617220 = r3617213 + r3617219;
        return r3617220;
}

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

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

Reproduce

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