Average Error: 4.7 → 1.9
Time: 17.8s
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.607571387390673746254385901061388733853 \cdot 10^{242} \lor \neg \left(\frac{y}{z} - \frac{t}{1 - z} \le 1.033198909281398080812943461012091912601 \cdot 10^{235}\right):\\ \;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - \left(\sqrt[3]{\frac{t}{1 - z}} \cdot \sqrt[3]{\frac{t}{1 - z}}\right) \cdot \sqrt[3]{\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.607571387390673746254385901061388733853 \cdot 10^{242} \lor \neg \left(\frac{y}{z} - \frac{t}{1 - z} \le 1.033198909281398080812943461012091912601 \cdot 10^{235}\right):\\
\;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r291919 = x;
        double r291920 = y;
        double r291921 = z;
        double r291922 = r291920 / r291921;
        double r291923 = t;
        double r291924 = 1.0;
        double r291925 = r291924 - r291921;
        double r291926 = r291923 / r291925;
        double r291927 = r291922 - r291926;
        double r291928 = r291919 * r291927;
        return r291928;
}

double f(double x, double y, double z, double t) {
        double r291929 = y;
        double r291930 = z;
        double r291931 = r291929 / r291930;
        double r291932 = t;
        double r291933 = 1.0;
        double r291934 = r291933 - r291930;
        double r291935 = r291932 / r291934;
        double r291936 = r291931 - r291935;
        double r291937 = -2.6075713873906737e+242;
        bool r291938 = r291936 <= r291937;
        double r291939 = 1.0331989092813981e+235;
        bool r291940 = r291936 <= r291939;
        double r291941 = !r291940;
        bool r291942 = r291938 || r291941;
        double r291943 = x;
        double r291944 = r291929 * r291934;
        double r291945 = r291930 * r291932;
        double r291946 = r291944 - r291945;
        double r291947 = r291943 * r291946;
        double r291948 = r291930 * r291934;
        double r291949 = r291947 / r291948;
        double r291950 = cbrt(r291935);
        double r291951 = r291950 * r291950;
        double r291952 = r291951 * r291950;
        double r291953 = r291931 - r291952;
        double r291954 = r291943 * r291953;
        double r291955 = r291942 ? r291949 : r291954;
        return r291955;
}

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.7
Target4.6
Herbie1.9
\[\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.6075713873906737e+242 or 1.0331989092813981e+235 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 28.5

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

      \[\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/2.9

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

    if -2.6075713873906737e+242 < (- (/ y z) (/ t (- 1.0 z))) < 1.0331989092813981e+235

    1. Initial program 1.3

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

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

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

Reproduce

herbie shell --seed 2019306 
(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.62322630331204244e-196) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 1.41339449277023022e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z)))))))

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