Average Error: 4.2 → 5.6
Time: 4.1s
Precision: 64
\[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le 2.6026198328523048 \cdot 10^{-57}:\\ \;\;\;\;x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{1}{\sqrt[3]{1 - z}}\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 8.72159814685539718 \cdot 10^{47}:\\ \;\;\;\;\frac{x \cdot \left(\frac{y}{z} \cdot \frac{y}{z} - \frac{t}{1 - z} \cdot \frac{t}{1 - z}\right)}{\frac{y}{z} + \frac{t}{1 - z}}\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 4.4577045978562027 \cdot 10^{100}:\\ \;\;\;\;x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{1}{\sqrt[3]{1 - z}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot x\right) \cdot \frac{\sqrt[3]{y}}{z} + x \cdot \left(-\frac{t}{1 - z}\right)\\ \end{array}\]
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le 2.6026198328523048 \cdot 10^{-57}:\\
\;\;\;\;x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{1}{\sqrt[3]{1 - z}}\right)\\

\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 8.72159814685539718 \cdot 10^{47}:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} \cdot \frac{y}{z} - \frac{t}{1 - z} \cdot \frac{t}{1 - z}\right)}{\frac{y}{z} + \frac{t}{1 - z}}\\

\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 4.4577045978562027 \cdot 10^{100}:\\
\;\;\;\;x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{1}{\sqrt[3]{1 - z}}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot x\right) \cdot \frac{\sqrt[3]{y}}{z} + x \cdot \left(-\frac{t}{1 - z}\right)\\

\end{array}
double f(double x, double y, double z, double t) {
        double r413348 = x;
        double r413349 = y;
        double r413350 = z;
        double r413351 = r413349 / r413350;
        double r413352 = t;
        double r413353 = 1.0;
        double r413354 = r413353 - r413350;
        double r413355 = r413352 / r413354;
        double r413356 = r413351 - r413355;
        double r413357 = r413348 * r413356;
        return r413357;
}

double f(double x, double y, double z, double t) {
        double r413358 = y;
        double r413359 = z;
        double r413360 = r413358 / r413359;
        double r413361 = t;
        double r413362 = 1.0;
        double r413363 = r413362 - r413359;
        double r413364 = r413361 / r413363;
        double r413365 = r413360 - r413364;
        double r413366 = 2.602619832852305e-57;
        bool r413367 = r413365 <= r413366;
        double r413368 = x;
        double r413369 = r413368 * r413360;
        double r413370 = r413368 * r413361;
        double r413371 = 1.0;
        double r413372 = cbrt(r413363);
        double r413373 = r413372 * r413372;
        double r413374 = r413371 / r413373;
        double r413375 = r413371 / r413372;
        double r413376 = r413374 * r413375;
        double r413377 = -r413376;
        double r413378 = r413370 * r413377;
        double r413379 = r413369 + r413378;
        double r413380 = 8.721598146855397e+47;
        bool r413381 = r413365 <= r413380;
        double r413382 = r413360 * r413360;
        double r413383 = r413364 * r413364;
        double r413384 = r413382 - r413383;
        double r413385 = r413368 * r413384;
        double r413386 = r413360 + r413364;
        double r413387 = r413385 / r413386;
        double r413388 = 4.457704597856203e+100;
        bool r413389 = r413365 <= r413388;
        double r413390 = cbrt(r413358);
        double r413391 = r413390 * r413390;
        double r413392 = r413391 * r413368;
        double r413393 = r413390 / r413359;
        double r413394 = r413392 * r413393;
        double r413395 = -r413364;
        double r413396 = r413368 * r413395;
        double r413397 = r413394 + r413396;
        double r413398 = r413389 ? r413379 : r413397;
        double r413399 = r413381 ? r413387 : r413398;
        double r413400 = r413367 ? r413379 : r413399;
        return r413400;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original4.2
Target4.1
Herbie5.6
\[\begin{array}{l} \mathbf{if}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \lt -7.62322630331204244 \cdot 10^{-196}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ \mathbf{elif}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \lt 1.41339449277023022 \cdot 10^{-211}:\\ \;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (- (/ y z) (/ t (- 1.0 z))) < 2.602619832852305e-57 or 8.721598146855397e+47 < (- (/ y z) (/ t (- 1.0 z))) < 4.457704597856203e+100

    1. Initial program 3.6

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
    2. Using strategy rm
    3. Applied sub-neg3.6

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} + \left(-\frac{t}{1 - z}\right)\right)}\]
    4. Applied distribute-lft-in3.6

      \[\leadsto \color{blue}{x \cdot \frac{y}{z} + x \cdot \left(-\frac{t}{1 - z}\right)}\]
    5. Using strategy rm
    6. Applied div-inv3.6

      \[\leadsto x \cdot \frac{y}{z} + x \cdot \left(-\color{blue}{t \cdot \frac{1}{1 - z}}\right)\]
    7. Applied distribute-rgt-neg-in3.6

      \[\leadsto x \cdot \frac{y}{z} + x \cdot \color{blue}{\left(t \cdot \left(-\frac{1}{1 - z}\right)\right)}\]
    8. Applied associate-*r*6.4

      \[\leadsto x \cdot \frac{y}{z} + \color{blue}{\left(x \cdot t\right) \cdot \left(-\frac{1}{1 - z}\right)}\]
    9. Using strategy rm
    10. Applied add-cube-cbrt6.6

      \[\leadsto x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\color{blue}{\left(\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}\right) \cdot \sqrt[3]{1 - z}}}\right)\]
    11. Applied add-cube-cbrt6.6

      \[\leadsto x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\left(\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}\right) \cdot \sqrt[3]{1 - z}}\right)\]
    12. Applied times-frac6.6

      \[\leadsto x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{1 - z}}}\right)\]
    13. Simplified6.6

      \[\leadsto x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\color{blue}{\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{1 - z}}\right)\]
    14. Simplified6.6

      \[\leadsto x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \color{blue}{\frac{1}{\sqrt[3]{1 - z}}}\right)\]

    if 2.602619832852305e-57 < (- (/ y z) (/ t (- 1.0 z))) < 8.721598146855397e+47

    1. Initial program 0.3

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
    2. Using strategy rm
    3. Applied flip--0.3

      \[\leadsto x \cdot \color{blue}{\frac{\frac{y}{z} \cdot \frac{y}{z} - \frac{t}{1 - z} \cdot \frac{t}{1 - z}}{\frac{y}{z} + \frac{t}{1 - z}}}\]
    4. Applied associate-*r/3.0

      \[\leadsto \color{blue}{\frac{x \cdot \left(\frac{y}{z} \cdot \frac{y}{z} - \frac{t}{1 - z} \cdot \frac{t}{1 - z}\right)}{\frac{y}{z} + \frac{t}{1 - z}}}\]

    if 4.457704597856203e+100 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 9.1

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
    2. Using strategy rm
    3. Applied sub-neg9.1

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} + \left(-\frac{t}{1 - z}\right)\right)}\]
    4. Applied distribute-lft-in9.1

      \[\leadsto \color{blue}{x \cdot \frac{y}{z} + x \cdot \left(-\frac{t}{1 - z}\right)}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity9.1

      \[\leadsto x \cdot \frac{y}{\color{blue}{1 \cdot z}} + x \cdot \left(-\frac{t}{1 - z}\right)\]
    7. Applied add-cube-cbrt9.6

      \[\leadsto x \cdot \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{1 \cdot z} + x \cdot \left(-\frac{t}{1 - z}\right)\]
    8. Applied times-frac9.6

      \[\leadsto x \cdot \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{z}\right)} + x \cdot \left(-\frac{t}{1 - z}\right)\]
    9. Applied associate-*r*3.2

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

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot x\right)} \cdot \frac{\sqrt[3]{y}}{z} + x \cdot \left(-\frac{t}{1 - z}\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification5.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le 2.6026198328523048 \cdot 10^{-57}:\\ \;\;\;\;x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{1}{\sqrt[3]{1 - z}}\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 8.72159814685539718 \cdot 10^{47}:\\ \;\;\;\;\frac{x \cdot \left(\frac{y}{z} \cdot \frac{y}{z} - \frac{t}{1 - z} \cdot \frac{t}{1 - z}\right)}{\frac{y}{z} + \frac{t}{1 - z}}\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 4.4577045978562027 \cdot 10^{100}:\\ \;\;\;\;x \cdot \frac{y}{z} + \left(x \cdot t\right) \cdot \left(-\frac{1}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{1}{\sqrt[3]{1 - z}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot x\right) \cdot \frac{\sqrt[3]{y}}{z} + x \cdot \left(-\frac{t}{1 - z}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020049 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

  :herbie-target
  (if (< (* x (- (/ y z) (/ t (- 1 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z)))))))

  (* x (- (/ y z) (/ t (- 1 z)))))