Average Error: 0.1 → 0.1
Time: 28.1s
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 r22371485 = x;
        double r22371486 = y;
        double r22371487 = r22371485 + r22371486;
        double r22371488 = z;
        double r22371489 = r22371487 + r22371488;
        double r22371490 = t;
        double r22371491 = log(r22371490);
        double r22371492 = r22371488 * r22371491;
        double r22371493 = r22371489 - r22371492;
        double r22371494 = a;
        double r22371495 = 0.5;
        double r22371496 = r22371494 - r22371495;
        double r22371497 = b;
        double r22371498 = r22371496 * r22371497;
        double r22371499 = r22371493 + r22371498;
        return r22371499;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r22371500 = b;
        double r22371501 = a;
        double r22371502 = 0.5;
        double r22371503 = r22371501 - r22371502;
        double r22371504 = x;
        double r22371505 = y;
        double r22371506 = r22371504 + r22371505;
        double r22371507 = fma(r22371500, r22371503, r22371506);
        double r22371508 = 1.0;
        double r22371509 = t;
        double r22371510 = log(r22371509);
        double r22371511 = r22371508 - r22371510;
        double r22371512 = z;
        double r22371513 = r22371511 * r22371512;
        double r22371514 = r22371507 + r22371513;
        return r22371514;
}

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