Average Error: 9.4 → 0.4
Time: 8.3s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right), z, \left(x \cdot \left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) + \left(x \cdot \frac{1}{3}\right) \cdot \log y\right) - t\right)\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right), z, \left(x \cdot \left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) + \left(x \cdot \frac{1}{3}\right) \cdot \log y\right) - t\right)
double f(double x, double y, double z, double t) {
        double r449350 = x;
        double r449351 = y;
        double r449352 = log(r449351);
        double r449353 = r449350 * r449352;
        double r449354 = z;
        double r449355 = 1.0;
        double r449356 = r449355 - r449351;
        double r449357 = log(r449356);
        double r449358 = r449354 * r449357;
        double r449359 = r449353 + r449358;
        double r449360 = t;
        double r449361 = r449359 - r449360;
        return r449361;
}

double f(double x, double y, double z, double t) {
        double r449362 = 1.0;
        double r449363 = log(r449362);
        double r449364 = y;
        double r449365 = 0.5;
        double r449366 = 2.0;
        double r449367 = pow(r449364, r449366);
        double r449368 = pow(r449362, r449366);
        double r449369 = r449367 / r449368;
        double r449370 = r449365 * r449369;
        double r449371 = fma(r449362, r449364, r449370);
        double r449372 = r449363 - r449371;
        double r449373 = z;
        double r449374 = x;
        double r449375 = cbrt(r449364);
        double r449376 = log(r449375);
        double r449377 = r449366 * r449376;
        double r449378 = r449374 * r449377;
        double r449379 = 0.3333333333333333;
        double r449380 = r449374 * r449379;
        double r449381 = log(r449364);
        double r449382 = r449380 * r449381;
        double r449383 = r449378 + r449382;
        double r449384 = t;
        double r449385 = r449383 - r449384;
        double r449386 = fma(r449372, r449373, r449385);
        return r449386;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.4
Target0.3
Herbie0.4
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333148296162562473909929395}{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.4

    \[\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 + z \cdot \color{blue}{\left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.3

    \[\leadsto \left(x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - \color{blue}{1 \cdot t}\]
  5. Applied *-un-lft-identity0.3

    \[\leadsto \color{blue}{1 \cdot \left(x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)} - 1 \cdot t\]
  6. Applied distribute-lft-out--0.3

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

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

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

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

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

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

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

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

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

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

Reproduce

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