Average Error: 0.1 → 0.1
Time: 28.6s
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(z, \mathsf{fma}\left(-2, \log \left(\sqrt[3]{t}\right), 1\right) - \log \left(\sqrt[3]{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\mathsf{fma}\left(z, \mathsf{fma}\left(-2, \log \left(\sqrt[3]{t}\right), 1\right) - \log \left(\sqrt[3]{t}\right), \mathsf{fma}\left(a - 0.5, b, x + y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r339773 = x;
        double r339774 = y;
        double r339775 = r339773 + r339774;
        double r339776 = z;
        double r339777 = r339775 + r339776;
        double r339778 = t;
        double r339779 = log(r339778);
        double r339780 = r339776 * r339779;
        double r339781 = r339777 - r339780;
        double r339782 = a;
        double r339783 = 0.5;
        double r339784 = r339782 - r339783;
        double r339785 = b;
        double r339786 = r339784 * r339785;
        double r339787 = r339781 + r339786;
        return r339787;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r339788 = z;
        double r339789 = -2.0;
        double r339790 = t;
        double r339791 = cbrt(r339790);
        double r339792 = log(r339791);
        double r339793 = 1.0;
        double r339794 = fma(r339789, r339792, r339793);
        double r339795 = r339794 - r339792;
        double r339796 = a;
        double r339797 = 0.5;
        double r339798 = r339796 - r339797;
        double r339799 = b;
        double r339800 = x;
        double r339801 = y;
        double r339802 = r339800 + r339801;
        double r339803 = fma(r339798, r339799, r339802);
        double r339804 = fma(r339788, r339795, r339803);
        return r339804;
}

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 add-cube-cbrt0.1

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

    \[\leadsto \mathsf{fma}\left(z, 1 - \color{blue}{\left(\log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + \log \left(\sqrt[3]{t}\right)\right)}, \mathsf{fma}\left(a - 0.5, b, x + y\right)\right)\]
  6. Applied associate--r+0.1

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

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

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

Reproduce

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