Average Error: 9.0 → 0.3
Time: 8.4s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(x \cdot \log \left(\sqrt[3]{y} \cdot {y}^{\frac{1}{3}}\right) + \mathsf{fma}\left(\log \left(\sqrt[3]{{y}^{\frac{2}{3}}} \cdot {\left(\sqrt[3]{y}\right)}^{\frac{1}{3}}\right), x, \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(x \cdot \log \left(\sqrt[3]{y} \cdot {y}^{\frac{1}{3}}\right) + \mathsf{fma}\left(\log \left(\sqrt[3]{{y}^{\frac{2}{3}}} \cdot {\left(\sqrt[3]{y}\right)}^{\frac{1}{3}}\right), x, \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r363562 = x;
        double r363563 = y;
        double r363564 = log(r363563);
        double r363565 = r363562 * r363564;
        double r363566 = z;
        double r363567 = 1.0;
        double r363568 = r363567 - r363563;
        double r363569 = log(r363568);
        double r363570 = r363566 * r363569;
        double r363571 = r363565 + r363570;
        double r363572 = t;
        double r363573 = r363571 - r363572;
        return r363573;
}

double f(double x, double y, double z, double t) {
        double r363574 = x;
        double r363575 = y;
        double r363576 = cbrt(r363575);
        double r363577 = 0.3333333333333333;
        double r363578 = pow(r363575, r363577);
        double r363579 = r363576 * r363578;
        double r363580 = log(r363579);
        double r363581 = r363574 * r363580;
        double r363582 = 0.6666666666666666;
        double r363583 = pow(r363575, r363582);
        double r363584 = cbrt(r363583);
        double r363585 = pow(r363576, r363577);
        double r363586 = r363584 * r363585;
        double r363587 = log(r363586);
        double r363588 = z;
        double r363589 = 1.0;
        double r363590 = log(r363589);
        double r363591 = r363588 * r363575;
        double r363592 = 0.5;
        double r363593 = 2.0;
        double r363594 = pow(r363575, r363593);
        double r363595 = r363588 * r363594;
        double r363596 = pow(r363589, r363593);
        double r363597 = r363595 / r363596;
        double r363598 = r363592 * r363597;
        double r363599 = fma(r363589, r363591, r363598);
        double r363600 = -r363599;
        double r363601 = fma(r363588, r363590, r363600);
        double r363602 = fma(r363587, r363574, r363601);
        double r363603 = r363581 + r363602;
        double r363604 = t;
        double r363605 = r363603 - r363604;
        return r363605;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.0
Target0.2
Herbie0.3
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.333333333333333315}{1 \cdot \left(1 \cdot 1\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)\]

Derivation

  1. Initial program 9.0

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
  2. Taylor expanded around 0 0.3

    \[\leadsto \left(x \cdot \log y + \color{blue}{\left(z \cdot \log 1 - \left(1 \cdot \left(z \cdot y\right) + \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Simplified0.3

    \[\leadsto \left(x \cdot \log y + \color{blue}{\mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  4. Using strategy rm
  5. Applied add-cube-cbrt0.3

    \[\leadsto \left(x \cdot \log \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} + \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right) - t\]
  6. Applied log-prod0.4

    \[\leadsto \left(x \cdot \color{blue}{\left(\log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \log \left(\sqrt[3]{y}\right)\right)} + \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right) - t\]
  7. Applied distribute-lft-in0.4

    \[\leadsto \left(\color{blue}{\left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + x \cdot \log \left(\sqrt[3]{y}\right)\right)} + \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right) - t\]
  8. Applied associate-+l+0.4

    \[\leadsto \color{blue}{\left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \left(x \cdot \log \left(\sqrt[3]{y}\right) + \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)\right)} - t\]
  9. Simplified0.4

    \[\leadsto \left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \color{blue}{\mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), x, \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)}\right) - t\]
  10. Using strategy rm
  11. Applied pow1/30.3

    \[\leadsto \left(x \cdot \log \left(\sqrt[3]{y} \cdot \color{blue}{{y}^{\frac{1}{3}}}\right) + \mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), x, \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
  12. Using strategy rm
  13. Applied add-cube-cbrt0.3

    \[\leadsto \left(x \cdot \log \left(\sqrt[3]{y} \cdot {y}^{\frac{1}{3}}\right) + \mathsf{fma}\left(\log \left(\sqrt[3]{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}\right), x, \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
  14. Applied cbrt-prod0.3

    \[\leadsto \left(x \cdot \log \left(\sqrt[3]{y} \cdot {y}^{\frac{1}{3}}\right) + \mathsf{fma}\left(\log \color{blue}{\left(\sqrt[3]{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \sqrt[3]{\sqrt[3]{y}}\right)}, x, \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
  15. Simplified0.4

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

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

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

Reproduce

herbie shell --seed 2020039 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))

  (- (+ (* x (log y)) (* z (log (- 1 y)))) t))