Average Error: 0.1 → 0.1
Time: 14.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(\left(1 - 2 \cdot \left(\log \left(\sqrt[3]{t}\right) + \log \left(\sqrt[3]{\sqrt[3]{t}}\right)\right)\right) - \log \left(\sqrt[3]{\sqrt[3]{t}}\right), z, \mathsf{fma}\left(a - 0.5, b, x\right)\right) + y\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\mathsf{fma}\left(\left(1 - 2 \cdot \left(\log \left(\sqrt[3]{t}\right) + \log \left(\sqrt[3]{\sqrt[3]{t}}\right)\right)\right) - \log \left(\sqrt[3]{\sqrt[3]{t}}\right), z, \mathsf{fma}\left(a - 0.5, b, x\right)\right) + y
double f(double x, double y, double z, double t, double a, double b) {
        double r455640 = x;
        double r455641 = y;
        double r455642 = r455640 + r455641;
        double r455643 = z;
        double r455644 = r455642 + r455643;
        double r455645 = t;
        double r455646 = log(r455645);
        double r455647 = r455643 * r455646;
        double r455648 = r455644 - r455647;
        double r455649 = a;
        double r455650 = 0.5;
        double r455651 = r455649 - r455650;
        double r455652 = b;
        double r455653 = r455651 * r455652;
        double r455654 = r455648 + r455653;
        return r455654;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r455655 = 1.0;
        double r455656 = 2.0;
        double r455657 = t;
        double r455658 = cbrt(r455657);
        double r455659 = log(r455658);
        double r455660 = cbrt(r455658);
        double r455661 = log(r455660);
        double r455662 = r455659 + r455661;
        double r455663 = r455656 * r455662;
        double r455664 = r455655 - r455663;
        double r455665 = r455664 - r455661;
        double r455666 = z;
        double r455667 = a;
        double r455668 = 0.5;
        double r455669 = r455667 - r455668;
        double r455670 = b;
        double r455671 = x;
        double r455672 = fma(r455669, r455670, r455671);
        double r455673 = fma(r455665, r455666, r455672);
        double r455674 = y;
        double r455675 = r455673 + r455674;
        return r455675;
}

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(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, x\right)\right) + y}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.1

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

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

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

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

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

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

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

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

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

Reproduce

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