Average Error: 0.1 → 0.1
Time: 10.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(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 r81005 = x;
        double r81006 = y;
        double r81007 = log(r81006);
        double r81008 = r81005 * r81007;
        double r81009 = z;
        double r81010 = r81008 + r81009;
        double r81011 = t;
        double r81012 = r81010 + r81011;
        double r81013 = a;
        double r81014 = r81012 + r81013;
        double r81015 = b;
        double r81016 = 0.5;
        double r81017 = r81015 - r81016;
        double r81018 = c;
        double r81019 = log(r81018);
        double r81020 = r81017 * r81019;
        double r81021 = r81014 + r81020;
        double r81022 = i;
        double r81023 = r81006 * r81022;
        double r81024 = r81021 + r81023;
        return r81024;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r81025 = i;
        double r81026 = y;
        double r81027 = c;
        double r81028 = log(r81027);
        double r81029 = b;
        double r81030 = 0.5;
        double r81031 = r81029 - r81030;
        double r81032 = x;
        double r81033 = log(r81026);
        double r81034 = z;
        double r81035 = fma(r81032, r81033, r81034);
        double r81036 = t;
        double r81037 = a;
        double r81038 = r81036 + r81037;
        double r81039 = r81035 + r81038;
        double r81040 = fma(r81028, r81031, r81039);
        double r81041 = fma(r81025, r81026, r81040);
        return r81041;
}

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