Average Error: 4.8 → 3.4
Time: 6.3s
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.824403065313703990418076790193964499788 \cdot 10^{277}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \left(\left(\sqrt[3]{\frac{1}{1 - z}} \cdot \sqrt[3]{\frac{1}{1 - z}}\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \sqrt[3]{1 - z} - z \cdot \left(t \cdot \left(\left(\sqrt[3]{\frac{1}{1 - z}} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)\right)}{z \cdot \sqrt[3]{1 - z}}\\ \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.824403065313703990418076790193964499788 \cdot 10^{277}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \left(\left(\sqrt[3]{\frac{1}{1 - z}} \cdot \sqrt[3]{\frac{1}{1 - z}}\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r343625 = x;
        double r343626 = y;
        double r343627 = z;
        double r343628 = r343626 / r343627;
        double r343629 = t;
        double r343630 = 1.0;
        double r343631 = r343630 - r343627;
        double r343632 = r343629 / r343631;
        double r343633 = r343628 - r343632;
        double r343634 = r343625 * r343633;
        return r343634;
}

double f(double x, double y, double z, double t) {
        double r343635 = y;
        double r343636 = z;
        double r343637 = r343635 / r343636;
        double r343638 = t;
        double r343639 = 1.0;
        double r343640 = r343639 - r343636;
        double r343641 = r343638 / r343640;
        double r343642 = r343637 - r343641;
        double r343643 = 2.824403065313704e+277;
        bool r343644 = r343642 <= r343643;
        double r343645 = x;
        double r343646 = 1.0;
        double r343647 = r343646 / r343640;
        double r343648 = cbrt(r343647);
        double r343649 = r343648 * r343648;
        double r343650 = r343649 * r343648;
        double r343651 = r343638 * r343650;
        double r343652 = r343637 - r343651;
        double r343653 = r343645 * r343652;
        double r343654 = cbrt(r343640);
        double r343655 = r343635 * r343654;
        double r343656 = cbrt(r343646);
        double r343657 = r343648 * r343656;
        double r343658 = r343657 * r343648;
        double r343659 = r343638 * r343658;
        double r343660 = r343636 * r343659;
        double r343661 = r343655 - r343660;
        double r343662 = r343645 * r343661;
        double r343663 = r343636 * r343654;
        double r343664 = r343662 / r343663;
        double r343665 = r343644 ? r343653 : r343664;
        return r343665;
}

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.8
Target4.4
Herbie3.4
\[\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 2 regimes
  2. if (- (/ y z) (/ t (- 1.0 z))) < 2.824403065313704e+277

    1. Initial program 3.2

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

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

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

    if 2.824403065313704e+277 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 40.5

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

      \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{t \cdot \frac{1}{1 - z}}\right)\]
    4. Using strategy rm
    5. Applied add-cube-cbrt40.5

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le 2.824403065313703990418076790193964499788 \cdot 10^{277}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \left(\left(\sqrt[3]{\frac{1}{1 - z}} \cdot \sqrt[3]{\frac{1}{1 - z}}\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \sqrt[3]{1 - z} - z \cdot \left(t \cdot \left(\left(\sqrt[3]{\frac{1}{1 - z}} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)\right)}{z \cdot \sqrt[3]{1 - z}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(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)))))