Average Error: 2.0 → 0.6
Time: 15.7s
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}\;x \le -1.02164264538042179 \cdot 10^{-94} \lor \neg \left(x \le 1.1903560079159271 \cdot 10^{-222}\right):\\ \;\;\;\;\frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\sqrt[3]{{\left(\mathsf{fma}\left(\log \left(\frac{1}{z}\right), y, \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)\right)}^{3}}}}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{e^{\mathsf{fma}\left(\log \left(\frac{1}{z}\right), y, \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \frac{x}{y}\\ \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}\;x \le -1.02164264538042179 \cdot 10^{-94} \lor \neg \left(x \le 1.1903560079159271 \cdot 10^{-222}\right):\\
\;\;\;\;\frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\sqrt[3]{{\left(\mathsf{fma}\left(\log \left(\frac{1}{z}\right), y, \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)\right)}^{3}}}}}{y}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r466286 = x;
        double r466287 = y;
        double r466288 = z;
        double r466289 = log(r466288);
        double r466290 = r466287 * r466289;
        double r466291 = t;
        double r466292 = 1.0;
        double r466293 = r466291 - r466292;
        double r466294 = a;
        double r466295 = log(r466294);
        double r466296 = r466293 * r466295;
        double r466297 = r466290 + r466296;
        double r466298 = b;
        double r466299 = r466297 - r466298;
        double r466300 = exp(r466299);
        double r466301 = r466286 * r466300;
        double r466302 = r466301 / r466287;
        return r466302;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r466303 = x;
        double r466304 = -1.0216426453804218e-94;
        bool r466305 = r466303 <= r466304;
        double r466306 = 1.190356007915927e-222;
        bool r466307 = r466303 <= r466306;
        double r466308 = !r466307;
        bool r466309 = r466305 || r466308;
        double r466310 = 1.0;
        double r466311 = a;
        double r466312 = r466310 / r466311;
        double r466313 = 1.0;
        double r466314 = pow(r466312, r466313);
        double r466315 = z;
        double r466316 = r466310 / r466315;
        double r466317 = log(r466316);
        double r466318 = y;
        double r466319 = log(r466312);
        double r466320 = t;
        double r466321 = b;
        double r466322 = fma(r466319, r466320, r466321);
        double r466323 = fma(r466317, r466318, r466322);
        double r466324 = 3.0;
        double r466325 = pow(r466323, r466324);
        double r466326 = cbrt(r466325);
        double r466327 = exp(r466326);
        double r466328 = r466314 / r466327;
        double r466329 = r466303 * r466328;
        double r466330 = r466329 / r466318;
        double r466331 = pow(r466311, r466313);
        double r466332 = r466310 / r466331;
        double r466333 = pow(r466332, r466313);
        double r466334 = exp(r466323);
        double r466335 = r466333 / r466334;
        double r466336 = r466303 / r466318;
        double r466337 = r466335 * r466336;
        double r466338 = r466309 ? r466330 : r466337;
        return r466338;
}

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

Original2.0
Target11.1
Herbie0.6
\[\begin{array}{l} \mathbf{if}\;t \lt -0.88458485041274715:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.22883740731:\\ \;\;\;\;\frac{\frac{x}{y} \cdot {a}^{\left(t - 1\right)}}{e^{b - \log z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -1.0216426453804218e-94 or 1.190356007915927e-222 < x

    1. Initial program 1.5

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

      \[\leadsto \frac{x \cdot \color{blue}{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. Simplified0.8

      \[\leadsto \frac{x \cdot \color{blue}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y}\]
    4. Using strategy rm
    5. Applied add-cbrt-cube0.8

      \[\leadsto \frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right) \cdot \mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)\right) \cdot \mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}}{y}\]
    6. Simplified0.8

      \[\leadsto \frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(\log \left(\frac{1}{z}\right), y, \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)\right)}^{3}}}}}}{y}\]

    if -1.0216426453804218e-94 < x < 1.190356007915927e-222

    1. Initial program 3.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 3.3

      \[\leadsto \frac{x \cdot \color{blue}{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. Simplified2.5

      \[\leadsto \frac{x \cdot \color{blue}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y}\]
    4. Using strategy rm
    5. Applied add-cbrt-cube2.5

      \[\leadsto \frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right) \cdot \mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)\right) \cdot \mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}}{y}\]
    6. Simplified2.5

      \[\leadsto \frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(\log \left(\frac{1}{z}\right), y, \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)\right)}^{3}}}}}}{y}\]
    7. Taylor expanded around inf 0.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.02164264538042179 \cdot 10^{-94} \lor \neg \left(x \le 1.1903560079159271 \cdot 10^{-222}\right):\\ \;\;\;\;\frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\sqrt[3]{{\left(\mathsf{fma}\left(\log \left(\frac{1}{z}\right), y, \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)\right)}^{3}}}}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{1}{{a}^{1}}\right)}^{1}}{e^{\mathsf{fma}\left(\log \left(\frac{1}{z}\right), y, \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}} \cdot \frac{x}{y}\\ \end{array}\]

Reproduce

herbie shell --seed 2020024 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z))))))

  (/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))