Average Error: 6.0 → 3.0
Time: 14.6s
Precision: 64
\[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\]
\[\begin{array}{l} \mathbf{if}\;\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z \le -1.4940895583547054 \cdot 10^{231}:\\ \;\;\;\;\mathsf{fma}\left(\frac{{z}^{2}}{x}, y, 7.93650079365100015 \cdot 10^{-4} \cdot \frac{{z}^{2}}{x} - \mathsf{fma}\left(\log \left(\frac{1}{x}\right), x, x\right)\right)\\ \mathbf{elif}\;\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z \le 4.64602826124195389 \cdot 10^{288}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\frac{x}{\mathsf{fma}\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778, z, 0.0833333333333329956\right)}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\mathsf{fma}\left(0.400000000000006406 \cdot x, z, 12.000000000000048 \cdot x - 0.100952278095241613 \cdot \left(x \cdot {z}^{2}\right)\right)} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\\ \end{array}\]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z \le -1.4940895583547054 \cdot 10^{231}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{z}^{2}}{x}, y, 7.93650079365100015 \cdot 10^{-4} \cdot \frac{{z}^{2}}{x} - \mathsf{fma}\left(\log \left(\frac{1}{x}\right), x, x\right)\right)\\

\mathbf{elif}\;\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z \le 4.64602826124195389 \cdot 10^{288}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\frac{x}{\mathsf{fma}\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778, z, 0.0833333333333329956\right)}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\mathsf{fma}\left(0.400000000000006406 \cdot x, z, 12.000000000000048 \cdot x - 0.100952278095241613 \cdot \left(x \cdot {z}^{2}\right)\right)} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\\

\end{array}
double f(double x, double y, double z) {
        double r584397 = x;
        double r584398 = 0.5;
        double r584399 = r584397 - r584398;
        double r584400 = log(r584397);
        double r584401 = r584399 * r584400;
        double r584402 = r584401 - r584397;
        double r584403 = 0.91893853320467;
        double r584404 = r584402 + r584403;
        double r584405 = y;
        double r584406 = 0.0007936500793651;
        double r584407 = r584405 + r584406;
        double r584408 = z;
        double r584409 = r584407 * r584408;
        double r584410 = 0.0027777777777778;
        double r584411 = r584409 - r584410;
        double r584412 = r584411 * r584408;
        double r584413 = 0.083333333333333;
        double r584414 = r584412 + r584413;
        double r584415 = r584414 / r584397;
        double r584416 = r584404 + r584415;
        return r584416;
}

double f(double x, double y, double z) {
        double r584417 = y;
        double r584418 = 0.0007936500793651;
        double r584419 = r584417 + r584418;
        double r584420 = z;
        double r584421 = r584419 * r584420;
        double r584422 = 0.0027777777777778;
        double r584423 = r584421 - r584422;
        double r584424 = r584423 * r584420;
        double r584425 = -1.4940895583547054e+231;
        bool r584426 = r584424 <= r584425;
        double r584427 = 2.0;
        double r584428 = pow(r584420, r584427);
        double r584429 = x;
        double r584430 = r584428 / r584429;
        double r584431 = r584418 * r584430;
        double r584432 = 1.0;
        double r584433 = r584432 / r584429;
        double r584434 = log(r584433);
        double r584435 = fma(r584434, r584429, r584429);
        double r584436 = r584431 - r584435;
        double r584437 = fma(r584430, r584417, r584436);
        double r584438 = 4.646028261241954e+288;
        bool r584439 = r584424 <= r584438;
        double r584440 = log(r584429);
        double r584441 = 0.5;
        double r584442 = r584429 - r584441;
        double r584443 = 0.083333333333333;
        double r584444 = fma(r584423, r584420, r584443);
        double r584445 = r584429 / r584444;
        double r584446 = r584432 / r584445;
        double r584447 = sqrt(r584429);
        double r584448 = 0.91893853320467;
        double r584449 = sqrt(r584448);
        double r584450 = r584447 - r584449;
        double r584451 = r584447 + r584449;
        double r584452 = r584450 * r584451;
        double r584453 = log1p(r584452);
        double r584454 = expm1(r584453);
        double r584455 = r584446 - r584454;
        double r584456 = -r584451;
        double r584457 = r584456 + r584451;
        double r584458 = r584450 * r584457;
        double r584459 = r584455 + r584458;
        double r584460 = fma(r584440, r584442, r584459);
        double r584461 = 0.4000000000000064;
        double r584462 = r584461 * r584429;
        double r584463 = 12.000000000000048;
        double r584464 = r584463 * r584429;
        double r584465 = 0.10095227809524161;
        double r584466 = r584429 * r584428;
        double r584467 = r584465 * r584466;
        double r584468 = r584464 - r584467;
        double r584469 = fma(r584462, r584420, r584468);
        double r584470 = r584432 / r584469;
        double r584471 = r584470 - r584454;
        double r584472 = r584471 + r584458;
        double r584473 = fma(r584440, r584442, r584472);
        double r584474 = r584439 ? r584460 : r584473;
        double r584475 = r584426 ? r584437 : r584474;
        return r584475;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original6.0
Target1.2
Herbie3.0
\[\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 - x\right)\right) + \frac{0.0833333333333329956}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right) - 0.0027777777777778\right)\]

Derivation

  1. Split input into 3 regimes
  2. if (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) < -1.4940895583547054e+231

    1. Initial program 40.0

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\]
    2. Simplified39.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(x - 0.91893853320467001\right)\right)}\]
    3. Taylor expanded around inf 39.9

      \[\leadsto \color{blue}{\left(7.93650079365100015 \cdot 10^{-4} \cdot \frac{{z}^{2}}{x} + \frac{{z}^{2} \cdot y}{x}\right) - \left(x + x \cdot \log \left(\frac{1}{x}\right)\right)}\]
    4. Simplified12.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{z}^{2}}{x}, y, 7.93650079365100015 \cdot 10^{-4} \cdot \frac{{z}^{2}}{x} - \mathsf{fma}\left(\log \left(\frac{1}{x}\right), x, x\right)\right)}\]

    if -1.4940895583547054e+231 < (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) < 4.646028261241954e+288

    1. Initial program 0.2

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\]
    2. Simplified0.2

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(x - 0.91893853320467001\right)\right)}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt0.2

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(x - \color{blue}{\sqrt{0.91893853320467001} \cdot \sqrt{0.91893853320467001}}\right)\right)\]
    5. Applied add-sqr-sqrt0.2

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} - \sqrt{0.91893853320467001} \cdot \sqrt{0.91893853320467001}\right)\right)\]
    6. Applied difference-of-squares0.2

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \color{blue}{\left(\sqrt{x} + \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} - \sqrt{0.91893853320467001}\right)}\right)\]
    7. Applied add-sqr-sqrt4.5

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \color{blue}{\sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}} \cdot \sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}}} - \left(\sqrt{x} + \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} - \sqrt{0.91893853320467001}\right)\right)\]
    8. Applied prod-diff4.5

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \color{blue}{\mathsf{fma}\left(\sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}}, \sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}}, -\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \mathsf{fma}\left(-\left(\sqrt{x} - \sqrt{0.91893853320467001}\right), \sqrt{x} + \sqrt{0.91893853320467001}, \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)}\right)\]
    9. Simplified0.2

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \color{blue}{\left(\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)} + \mathsf{fma}\left(-\left(\sqrt{x} - \sqrt{0.91893853320467001}\right), \sqrt{x} + \sqrt{0.91893853320467001}, \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    10. Simplified0.2

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \color{blue}{\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)}\right)\]
    11. Using strategy rm
    12. Applied expm1-log1p-u0.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)}\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    13. Using strategy rm
    14. Applied clear-num0.2

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\color{blue}{\frac{1}{\frac{x}{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    15. Simplified0.2

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\color{blue}{\frac{x}{\mathsf{fma}\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778, z, 0.0833333333333329956\right)}}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]

    if 4.646028261241954e+288 < (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)

    1. Initial program 56.1

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\]
    2. Simplified56.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(x - 0.91893853320467001\right)\right)}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(x - \color{blue}{\sqrt{0.91893853320467001} \cdot \sqrt{0.91893853320467001}}\right)\right)\]
    5. Applied add-sqr-sqrt56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} - \sqrt{0.91893853320467001} \cdot \sqrt{0.91893853320467001}\right)\right)\]
    6. Applied difference-of-squares56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \color{blue}{\left(\sqrt{x} + \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} - \sqrt{0.91893853320467001}\right)}\right)\]
    7. Applied add-sqr-sqrt56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \color{blue}{\sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}} \cdot \sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}}} - \left(\sqrt{x} + \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} - \sqrt{0.91893853320467001}\right)\right)\]
    8. Applied prod-diff56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \color{blue}{\mathsf{fma}\left(\sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}}, \sqrt{\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}}, -\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \mathsf{fma}\left(-\left(\sqrt{x} - \sqrt{0.91893853320467001}\right), \sqrt{x} + \sqrt{0.91893853320467001}, \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)}\right)\]
    9. Simplified56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \color{blue}{\left(\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)} + \mathsf{fma}\left(-\left(\sqrt{x} - \sqrt{0.91893853320467001}\right), \sqrt{x} + \sqrt{0.91893853320467001}, \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    10. Simplified56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \color{blue}{\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)}\right)\]
    11. Using strategy rm
    12. Applied expm1-log1p-u56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)}\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    13. Using strategy rm
    14. Applied clear-num56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\color{blue}{\frac{1}{\frac{x}{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    15. Simplified56.1

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\color{blue}{\frac{x}{\mathsf{fma}\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778, z, 0.0833333333333329956\right)}}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    16. Taylor expanded around 0 43.7

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\color{blue}{\left(0.400000000000006406 \cdot \left(x \cdot z\right) + 12.000000000000048 \cdot x\right) - 0.100952278095241613 \cdot \left(x \cdot {z}^{2}\right)}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
    17. Simplified30.3

      \[\leadsto \mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\color{blue}{\mathsf{fma}\left(0.400000000000006406 \cdot x, z, 12.000000000000048 \cdot x - 0.100952278095241613 \cdot \left(x \cdot {z}^{2}\right)\right)}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification3.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z \le -1.4940895583547054 \cdot 10^{231}:\\ \;\;\;\;\mathsf{fma}\left(\frac{{z}^{2}}{x}, y, 7.93650079365100015 \cdot 10^{-4} \cdot \frac{{z}^{2}}{x} - \mathsf{fma}\left(\log \left(\frac{1}{x}\right), x, x\right)\right)\\ \mathbf{elif}\;\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z \le 4.64602826124195389 \cdot 10^{288}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\frac{x}{\mathsf{fma}\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778, z, 0.0833333333333329956\right)}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x - 0.5, \left(\frac{1}{\mathsf{fma}\left(0.400000000000006406 \cdot x, z, 12.000000000000048 \cdot x - 0.100952278095241613 \cdot \left(x \cdot {z}^{2}\right)\right)} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\right) + \left(\sqrt{x} - \sqrt{0.91893853320467001}\right) \cdot \left(\left(-\left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right) + \left(\sqrt{x} + \sqrt{0.91893853320467001}\right)\right)\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))

  (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))