Average Error: 4.5 → 1.2
Time: 11.2s
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 -5.355774644879948828569583241788949268337 \cdot 10^{176}:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le -1.033153833188035003825148092583447604309 \cdot 10^{-178}:\\ \;\;\;\;\left(\sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt[3]{\left(\sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}\right) \cdot \sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 2.934496671973280465882952119286825129562 \cdot 10^{-221}:\\ \;\;\;\;\left(\frac{1}{z} + 1\right) \cdot \frac{t \cdot x}{z} + \frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 3.897737938729328806287191979521453864406 \cdot 10^{213}:\\ \;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \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 -5.355774644879948828569583241788949268337 \cdot 10^{176}:\\
\;\;\;\;\frac{x \cdot y}{z} + \left(-\frac{t}{1 - z}\right) \cdot x\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r342455 = x;
        double r342456 = y;
        double r342457 = z;
        double r342458 = r342456 / r342457;
        double r342459 = t;
        double r342460 = 1.0;
        double r342461 = r342460 - r342457;
        double r342462 = r342459 / r342461;
        double r342463 = r342458 - r342462;
        double r342464 = r342455 * r342463;
        return r342464;
}

double f(double x, double y, double z, double t) {
        double r342465 = y;
        double r342466 = z;
        double r342467 = r342465 / r342466;
        double r342468 = t;
        double r342469 = 1.0;
        double r342470 = r342469 - r342466;
        double r342471 = r342468 / r342470;
        double r342472 = r342467 - r342471;
        double r342473 = -5.355774644879949e+176;
        bool r342474 = r342472 <= r342473;
        double r342475 = x;
        double r342476 = r342475 * r342465;
        double r342477 = r342476 / r342466;
        double r342478 = -r342471;
        double r342479 = r342478 * r342475;
        double r342480 = r342477 + r342479;
        double r342481 = -1.033153833188035e-178;
        bool r342482 = r342472 <= r342481;
        double r342483 = r342475 * r342472;
        double r342484 = cbrt(r342483);
        double r342485 = r342484 * r342484;
        double r342486 = r342485 * r342484;
        double r342487 = cbrt(r342486);
        double r342488 = r342484 * r342487;
        double r342489 = cbrt(r342475);
        double r342490 = cbrt(r342472);
        double r342491 = r342489 * r342490;
        double r342492 = r342488 * r342491;
        double r342493 = 2.9344966719732805e-221;
        bool r342494 = r342472 <= r342493;
        double r342495 = r342469 / r342466;
        double r342496 = 1.0;
        double r342497 = r342495 + r342496;
        double r342498 = r342468 * r342475;
        double r342499 = r342498 / r342466;
        double r342500 = r342497 * r342499;
        double r342501 = r342500 + r342477;
        double r342502 = 3.897737938729329e+213;
        bool r342503 = r342472 <= r342502;
        double r342504 = r342489 * r342489;
        double r342505 = r342489 * r342472;
        double r342506 = r342504 * r342505;
        double r342507 = r342503 ? r342506 : r342480;
        double r342508 = r342494 ? r342501 : r342507;
        double r342509 = r342482 ? r342492 : r342508;
        double r342510 = r342474 ? r342480 : r342509;
        return r342510;
}

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.5
Target4.2
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \lt -7.623226303312042442144691872793570510727 \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.413394492770230216018398633584271456447 \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 4 regimes
  2. if (- (/ y z) (/ t (- 1.0 z))) < -5.355774644879949e+176 or 3.897737938729329e+213 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 18.0

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

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

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

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

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

    if -5.355774644879949e+176 < (- (/ y z) (/ t (- 1.0 z))) < -1.033153833188035e-178

    1. Initial program 0.2

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}\right) \cdot \sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}}\]
    4. Using strategy rm
    5. Applied cbrt-prod1.2

      \[\leadsto \left(\sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}\right) \cdot \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}\right)}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt1.3

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

    if -1.033153833188035e-178 < (- (/ y z) (/ t (- 1.0 z))) < 2.9344966719732805e-221

    1. Initial program 7.5

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

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

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

    if 2.9344966719732805e-221 < (- (/ y z) (/ t (- 1.0 z))) < 3.897737938729329e+213

    1. Initial program 0.2

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

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
    4. Applied associate-*l*1.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le -5.355774644879948828569583241788949268337 \cdot 10^{176}:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le -1.033153833188035003825148092583447604309 \cdot 10^{-178}:\\ \;\;\;\;\left(\sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt[3]{\left(\sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}\right) \cdot \sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 2.934496671973280465882952119286825129562 \cdot 10^{-221}:\\ \;\;\;\;\left(\frac{1}{z} + 1\right) \cdot \frac{t \cdot x}{z} + \frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 3.897737938729328806287191979521453864406 \cdot 10^{213}:\\ \;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \end{array}\]

Reproduce

herbie shell --seed 2019350 
(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)))))