Average Error: 0.1 → 0.1
Time: 26.8s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[\left(x + y\right) + \mathsf{fma}\left(b, a - 0.5, z - z \cdot \log t\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\left(x + y\right) + \mathsf{fma}\left(b, a - 0.5, z - z \cdot \log t\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r291259 = x;
        double r291260 = y;
        double r291261 = r291259 + r291260;
        double r291262 = z;
        double r291263 = r291261 + r291262;
        double r291264 = t;
        double r291265 = log(r291264);
        double r291266 = r291262 * r291265;
        double r291267 = r291263 - r291266;
        double r291268 = a;
        double r291269 = 0.5;
        double r291270 = r291268 - r291269;
        double r291271 = b;
        double r291272 = r291270 * r291271;
        double r291273 = r291267 + r291272;
        return r291273;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r291274 = x;
        double r291275 = y;
        double r291276 = r291274 + r291275;
        double r291277 = b;
        double r291278 = a;
        double r291279 = 0.5;
        double r291280 = r291278 - r291279;
        double r291281 = z;
        double r291282 = t;
        double r291283 = log(r291282);
        double r291284 = r291281 * r291283;
        double r291285 = r291281 - r291284;
        double r291286 = fma(r291277, r291280, r291285);
        double r291287 = r291276 + r291286;
        return r291287;
}

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. Using strategy rm
  3. Applied associate--l+0.1

    \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b\]
  4. Applied associate-+l+0.1

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

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

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

Reproduce

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

  :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)))