Average Error: 0.1 → 0.1
Time: 30.1s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a - 0.5, b, x + y\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a - 0.5, b, x + y\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r269003 = x;
        double r269004 = y;
        double r269005 = r269003 + r269004;
        double r269006 = z;
        double r269007 = r269005 + r269006;
        double r269008 = t;
        double r269009 = log(r269008);
        double r269010 = r269006 * r269009;
        double r269011 = r269007 - r269010;
        double r269012 = a;
        double r269013 = 0.5;
        double r269014 = r269012 - r269013;
        double r269015 = b;
        double r269016 = r269014 * r269015;
        double r269017 = r269011 + r269016;
        return r269017;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r269018 = z;
        double r269019 = 1.0;
        double r269020 = t;
        double r269021 = log(r269020);
        double r269022 = r269019 - r269021;
        double r269023 = r269018 * r269022;
        double r269024 = a;
        double r269025 = 0.5;
        double r269026 = r269024 - r269025;
        double r269027 = b;
        double r269028 = x;
        double r269029 = y;
        double r269030 = r269028 + r269029;
        double r269031 = fma(r269026, r269027, r269030);
        double r269032 = r269023 + r269031;
        return r269032;
}

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.4
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(a - 0.5, b, x + y\right)\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

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

    \[\leadsto \color{blue}{\left(z - \log t \cdot z\right)} + \mathsf{fma}\left(a - 0.5, b, x + y\right)\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.1

    \[\leadsto \left(\color{blue}{1 \cdot z} - \log t \cdot z\right) + \mathsf{fma}\left(a - 0.5, b, x + y\right)\]
  8. Applied distribute-rgt-out--0.1

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

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

Reproduce

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