Average Error: 0.1 → 0.1
Time: 27.8s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[\mathsf{fma}\left(b, a - 0.5, x + y\right) + \left(1 - \log t\right) \cdot z\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\mathsf{fma}\left(b, a - 0.5, x + y\right) + \left(1 - \log t\right) \cdot z
double f(double x, double y, double z, double t, double a, double b) {
        double r20705009 = x;
        double r20705010 = y;
        double r20705011 = r20705009 + r20705010;
        double r20705012 = z;
        double r20705013 = r20705011 + r20705012;
        double r20705014 = t;
        double r20705015 = log(r20705014);
        double r20705016 = r20705012 * r20705015;
        double r20705017 = r20705013 - r20705016;
        double r20705018 = a;
        double r20705019 = 0.5;
        double r20705020 = r20705018 - r20705019;
        double r20705021 = b;
        double r20705022 = r20705020 * r20705021;
        double r20705023 = r20705017 + r20705022;
        return r20705023;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r20705024 = b;
        double r20705025 = a;
        double r20705026 = 0.5;
        double r20705027 = r20705025 - r20705026;
        double r20705028 = x;
        double r20705029 = y;
        double r20705030 = r20705028 + r20705029;
        double r20705031 = fma(r20705024, r20705027, r20705030);
        double r20705032 = 1.0;
        double r20705033 = t;
        double r20705034 = log(r20705033);
        double r20705035 = r20705032 - r20705034;
        double r20705036 = z;
        double r20705037 = r20705035 * r20705036;
        double r20705038 = r20705031 + r20705037;
        return r20705038;
}

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

Target

Original0.1
Target0.3
Herbie0.1
\[\left(\left(x + y\right) + \frac{\left(1 - {\left(\log t\right)}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b\]

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(b, a - 0.5, y + x\right)\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

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

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))