Average Error: 0.1 → 0.1
Time: 6.5s
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, \mathsf{fma}\left(z, \left(1 - 2 \cdot \log \left(\sqrt{\sqrt[3]{t}} \cdot \sqrt{\sqrt[3]{t}}\right)\right) - \log \left(\sqrt[3]{t}\right), 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(b, a - 0.5, \mathsf{fma}\left(z, \left(1 - 2 \cdot \log \left(\sqrt{\sqrt[3]{t}} \cdot \sqrt{\sqrt[3]{t}}\right)\right) - \log \left(\sqrt[3]{t}\right), x + y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r421016 = x;
        double r421017 = y;
        double r421018 = r421016 + r421017;
        double r421019 = z;
        double r421020 = r421018 + r421019;
        double r421021 = t;
        double r421022 = log(r421021);
        double r421023 = r421019 * r421022;
        double r421024 = r421020 - r421023;
        double r421025 = a;
        double r421026 = 0.5;
        double r421027 = r421025 - r421026;
        double r421028 = b;
        double r421029 = r421027 * r421028;
        double r421030 = r421024 + r421029;
        return r421030;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r421031 = b;
        double r421032 = a;
        double r421033 = 0.5;
        double r421034 = r421032 - r421033;
        double r421035 = z;
        double r421036 = 1.0;
        double r421037 = 2.0;
        double r421038 = t;
        double r421039 = cbrt(r421038);
        double r421040 = sqrt(r421039);
        double r421041 = r421040 * r421040;
        double r421042 = log(r421041);
        double r421043 = r421037 * r421042;
        double r421044 = r421036 - r421043;
        double r421045 = log(r421039);
        double r421046 = r421044 - r421045;
        double r421047 = x;
        double r421048 = y;
        double r421049 = r421047 + r421048;
        double r421050 = fma(r421035, r421046, r421049);
        double r421051 = fma(r421031, r421034, r421050);
        return r421051;
}

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(b, a - 0.5, \left(\left(x + y\right) + z\right) - z \cdot \log t\right)}\]
  3. Taylor expanded around 0 0.1

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

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \color{blue}{\mathsf{fma}\left(z, 1 - \log t, x + y\right)}\right)\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.1

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

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \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)}, x + y\right)\right)\]
  8. Applied associate--r+0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \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)}, x + y\right)\right)\]
  9. Simplified0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, \color{blue}{\left(1 - 2 \cdot \log \left(\sqrt[3]{t}\right)\right)} - \log \left(\sqrt[3]{t}\right), x + y\right)\right)\]
  10. Using strategy rm
  11. Applied add-sqr-sqrt0.1

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

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

Reproduce

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