Average Error: 4.4 → 2.0
Time: 4.0s
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 -8.7903518607384625 \cdot 10^{237}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 6.001545022538113 \cdot 10^{131}:\\ \;\;\;\;\left(x \cdot \left(\sqrt[3]{\frac{y}{z}} \cdot \sqrt[3]{\frac{y}{z}}\right)\right) \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{\frac{1}{z}}\right) + x \cdot \left(-\frac{t}{1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{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 -8.7903518607384625 \cdot 10^{237}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r459818 = x;
        double r459819 = y;
        double r459820 = z;
        double r459821 = r459819 / r459820;
        double r459822 = t;
        double r459823 = 1.0;
        double r459824 = r459823 - r459820;
        double r459825 = r459822 / r459824;
        double r459826 = r459821 - r459825;
        double r459827 = r459818 * r459826;
        return r459827;
}

double f(double x, double y, double z, double t) {
        double r459828 = y;
        double r459829 = z;
        double r459830 = r459828 / r459829;
        double r459831 = t;
        double r459832 = 1.0;
        double r459833 = r459832 - r459829;
        double r459834 = r459831 / r459833;
        double r459835 = r459830 - r459834;
        double r459836 = -8.790351860738462e+237;
        bool r459837 = r459835 <= r459836;
        double r459838 = x;
        double r459839 = r459828 * r459833;
        double r459840 = r459829 * r459831;
        double r459841 = r459839 - r459840;
        double r459842 = r459838 * r459841;
        double r459843 = r459829 * r459833;
        double r459844 = r459842 / r459843;
        double r459845 = 6.001545022538113e+131;
        bool r459846 = r459835 <= r459845;
        double r459847 = cbrt(r459830);
        double r459848 = r459847 * r459847;
        double r459849 = r459838 * r459848;
        double r459850 = cbrt(r459828);
        double r459851 = 1.0;
        double r459852 = r459851 / r459829;
        double r459853 = cbrt(r459852);
        double r459854 = r459850 * r459853;
        double r459855 = r459849 * r459854;
        double r459856 = -r459834;
        double r459857 = r459838 * r459856;
        double r459858 = r459855 + r459857;
        double r459859 = r459838 * r459828;
        double r459860 = r459859 * r459852;
        double r459861 = r459860 + r459857;
        double r459862 = r459846 ? r459858 : r459861;
        double r459863 = r459837 ? r459844 : r459862;
        return r459863;
}

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.4
Target4.1
Herbie2.0
\[\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))) < -8.790351860738462e+237

    1. Initial program 25.7

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

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

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

    if -8.790351860738462e+237 < (- (/ y z) (/ t (- 1.0 z))) < 6.001545022538113e+131

    1. Initial program 1.4

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot \left(\sqrt[3]{\frac{y}{z}} \cdot \sqrt[3]{\frac{y}{z}}\right)\right) \cdot \sqrt[3]{\frac{y}{z}}} + x \cdot \left(-\frac{t}{1 - z}\right)\]
    8. Using strategy rm
    9. Applied div-inv1.9

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

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

    if 6.001545022538113e+131 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 11.8

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

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

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

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

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

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

Reproduce

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