Average Error: 2.1 → 1.4
Time: 18.2s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\begin{array}{l} \mathbf{if}\;\left(t - 1\right) \cdot \log a \le -7.27577864358483626 \cdot 10^{49} \lor \neg \left(\left(t - 1\right) \cdot \log a \le -24.655976153418436\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a \cdot y}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}\\ \end{array}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \le -7.27577864358483626 \cdot 10^{49} \lor \neg \left(\left(t - 1\right) \cdot \log a \le -24.655976153418436\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a \cdot y}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r114426 = x;
        double r114427 = y;
        double r114428 = z;
        double r114429 = log(r114428);
        double r114430 = r114427 * r114429;
        double r114431 = t;
        double r114432 = 1.0;
        double r114433 = r114431 - r114432;
        double r114434 = a;
        double r114435 = log(r114434);
        double r114436 = r114433 * r114435;
        double r114437 = r114430 + r114436;
        double r114438 = b;
        double r114439 = r114437 - r114438;
        double r114440 = exp(r114439);
        double r114441 = r114426 * r114440;
        double r114442 = r114441 / r114427;
        return r114442;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r114443 = t;
        double r114444 = 1.0;
        double r114445 = r114443 - r114444;
        double r114446 = a;
        double r114447 = log(r114446);
        double r114448 = r114445 * r114447;
        double r114449 = -7.275778643584836e+49;
        bool r114450 = r114448 <= r114449;
        double r114451 = -24.655976153418436;
        bool r114452 = r114448 <= r114451;
        double r114453 = !r114452;
        bool r114454 = r114450 || r114453;
        double r114455 = x;
        double r114456 = y;
        double r114457 = z;
        double r114458 = log(r114457);
        double r114459 = r114456 * r114458;
        double r114460 = r114459 + r114448;
        double r114461 = b;
        double r114462 = r114460 - r114461;
        double r114463 = exp(r114462);
        double r114464 = r114455 * r114463;
        double r114465 = r114464 / r114456;
        double r114466 = r114446 * r114456;
        double r114467 = r114455 / r114466;
        double r114468 = -r114458;
        double r114469 = -r114447;
        double r114470 = fma(r114469, r114443, r114461);
        double r114471 = fma(r114456, r114468, r114470);
        double r114472 = exp(r114471);
        double r114473 = r114467 / r114472;
        double r114474 = r114454 ? r114465 : r114473;
        return r114474;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (* (- t 1.0) (log a)) < -7.275778643584836e+49 or -24.655976153418436 < (* (- t 1.0) (log a))

    1. Initial program 0.6

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]

    if -7.275778643584836e+49 < (* (- t 1.0) (log a)) < -24.655976153418436

    1. Initial program 5.3

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
    2. Taylor expanded around inf 5.3

      \[\leadsto \color{blue}{\frac{x \cdot e^{1 \cdot \log \left(\frac{1}{a}\right) - \left(y \cdot \log \left(\frac{1}{z}\right) + \left(\log \left(\frac{1}{a}\right) \cdot t + b\right)\right)}}{y}}\]
    3. Simplified6.9

      \[\leadsto \color{blue}{\frac{\frac{\frac{x}{{a}^{1}}}{y}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}}\]
    4. Taylor expanded around inf 3.0

      \[\leadsto \frac{\color{blue}{\frac{x}{a \cdot y}}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(t - 1\right) \cdot \log a \le -7.27577864358483626 \cdot 10^{49} \lor \neg \left(\left(t - 1\right) \cdot \log a \le -24.655976153418436\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a \cdot y}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020045 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2"
  :precision binary64
  (/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))