Average Error: 0.1 → 0.1
Time: 39.2s
Precision: 64
\[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\]
\[\left(\left(t + \mathsf{fma}\left(\log y, x, z\right)\right) + \mathsf{fma}\left(y, i, a\right)\right) + \mathsf{fma}\left(b - 0.5, \log \left(\sqrt[3]{c}\right) + \log \left(\sqrt[3]{c}\right), \left(b - 0.5\right) \cdot \log \left(\sqrt[3]{c}\right)\right)\]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\left(\left(t + \mathsf{fma}\left(\log y, x, z\right)\right) + \mathsf{fma}\left(y, i, a\right)\right) + \mathsf{fma}\left(b - 0.5, \log \left(\sqrt[3]{c}\right) + \log \left(\sqrt[3]{c}\right), \left(b - 0.5\right) \cdot \log \left(\sqrt[3]{c}\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3450430 = x;
        double r3450431 = y;
        double r3450432 = log(r3450431);
        double r3450433 = r3450430 * r3450432;
        double r3450434 = z;
        double r3450435 = r3450433 + r3450434;
        double r3450436 = t;
        double r3450437 = r3450435 + r3450436;
        double r3450438 = a;
        double r3450439 = r3450437 + r3450438;
        double r3450440 = b;
        double r3450441 = 0.5;
        double r3450442 = r3450440 - r3450441;
        double r3450443 = c;
        double r3450444 = log(r3450443);
        double r3450445 = r3450442 * r3450444;
        double r3450446 = r3450439 + r3450445;
        double r3450447 = i;
        double r3450448 = r3450431 * r3450447;
        double r3450449 = r3450446 + r3450448;
        return r3450449;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3450450 = t;
        double r3450451 = y;
        double r3450452 = log(r3450451);
        double r3450453 = x;
        double r3450454 = z;
        double r3450455 = fma(r3450452, r3450453, r3450454);
        double r3450456 = r3450450 + r3450455;
        double r3450457 = i;
        double r3450458 = a;
        double r3450459 = fma(r3450451, r3450457, r3450458);
        double r3450460 = r3450456 + r3450459;
        double r3450461 = b;
        double r3450462 = 0.5;
        double r3450463 = r3450461 - r3450462;
        double r3450464 = c;
        double r3450465 = cbrt(r3450464);
        double r3450466 = log(r3450465);
        double r3450467 = r3450466 + r3450466;
        double r3450468 = r3450463 * r3450466;
        double r3450469 = fma(r3450463, r3450467, r3450468);
        double r3450470 = r3450460 + r3450469;
        return r3450470;
}

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

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + t\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

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

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

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

    \[\leadsto \left(b - 0.5\right) \cdot \color{blue}{\left(\log \left(\sqrt[3]{c} \cdot \sqrt[3]{c}\right) + \log \left(\sqrt[3]{c}\right)\right)} + \left(\mathsf{fma}\left(y, i, a\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + t\right)\right)\]
  9. Applied distribute-lft-in0.1

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

    \[\leadsto \left(\color{blue}{\left(\left(b - 0.5\right) \cdot \log \left(\sqrt[3]{c}\right) + \left(b - 0.5\right) \cdot \log \left(\sqrt[3]{c}\right)\right)} + \left(b - 0.5\right) \cdot \log \left(\sqrt[3]{c}\right)\right) + \left(\mathsf{fma}\left(y, i, a\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + t\right)\right)\]
  11. Using strategy rm
  12. Applied distribute-lft-out0.1

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

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

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
  (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))