Average Error: 4.4 → 4.4
Time: 21.2s
Precision: 64
\[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.2101704997358074 \cdot 10^{102}:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(-t\right) \cdot \frac{x}{1 - z}\\ \mathbf{elif}\;x \le -2.64010970512552713 \cdot 10^{-286}:\\ \;\;\;\;y \cdot \frac{x}{z} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \mathbf{elif}\;x \le 1.70551157256399953 \cdot 10^{-66}:\\ \;\;\;\;\left(-\sqrt[3]{\frac{t}{1 - z}} \cdot \sqrt[3]{\frac{t}{1 - z}}\right) \cdot \left(\sqrt[3]{\frac{t}{1 - z}} \cdot x\right) + \frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{t}{1 - z}\right) \cdot x + \frac{x}{\frac{z}{y}}\\ \end{array}\]
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\begin{array}{l}
\mathbf{if}\;x \le -2.2101704997358074 \cdot 10^{102}:\\
\;\;\;\;\frac{x \cdot y}{z} + \left(-t\right) \cdot \frac{x}{1 - z}\\

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r317962 = x;
        double r317963 = y;
        double r317964 = z;
        double r317965 = r317963 / r317964;
        double r317966 = t;
        double r317967 = 1.0;
        double r317968 = r317967 - r317964;
        double r317969 = r317966 / r317968;
        double r317970 = r317965 - r317969;
        double r317971 = r317962 * r317970;
        return r317971;
}

double f(double x, double y, double z, double t) {
        double r317972 = x;
        double r317973 = -2.2101704997358074e+102;
        bool r317974 = r317972 <= r317973;
        double r317975 = y;
        double r317976 = r317972 * r317975;
        double r317977 = z;
        double r317978 = r317976 / r317977;
        double r317979 = t;
        double r317980 = -r317979;
        double r317981 = 1.0;
        double r317982 = r317981 - r317977;
        double r317983 = r317972 / r317982;
        double r317984 = r317980 * r317983;
        double r317985 = r317978 + r317984;
        double r317986 = -2.640109705125527e-286;
        bool r317987 = r317972 <= r317986;
        double r317988 = r317972 / r317977;
        double r317989 = r317975 * r317988;
        double r317990 = r317979 / r317982;
        double r317991 = -r317990;
        double r317992 = r317991 * r317972;
        double r317993 = r317989 + r317992;
        double r317994 = 1.7055115725639995e-66;
        bool r317995 = r317972 <= r317994;
        double r317996 = cbrt(r317990);
        double r317997 = r317996 * r317996;
        double r317998 = -r317997;
        double r317999 = r317996 * r317972;
        double r318000 = r317998 * r317999;
        double r318001 = r318000 + r317978;
        double r318002 = r317977 / r317975;
        double r318003 = r317972 / r318002;
        double r318004 = r317992 + r318003;
        double r318005 = r317995 ? r318001 : r318004;
        double r318006 = r317987 ? r317993 : r318005;
        double r318007 = r317974 ? r317985 : r318006;
        return r318007;
}

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
Herbie4.4
\[\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 4 regimes
  2. if x < -2.2101704997358074e+102

    1. Initial program 4.4

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{y}{z}\right)}^{1}} \cdot {x}^{1} + \left(-\frac{t}{1 - z}\right) \cdot x\]
    8. Applied pow-prod-down4.4

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

      \[\leadsto {\color{blue}{\left(\frac{x \cdot y}{z}\right)}}^{1} + \left(-\frac{t}{1 - z}\right) \cdot x\]
    10. Using strategy rm
    11. Applied div-inv13.4

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

      \[\leadsto {\left(\frac{x \cdot y}{z}\right)}^{1} + \color{blue}{\left(\left(-t\right) \cdot \frac{1}{1 - z}\right)} \cdot x\]
    13. Applied associate-*l*11.4

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

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

    if -2.2101704997358074e+102 < x < -2.640109705125527e-286

    1. Initial program 4.3

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

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

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

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

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

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

    if -2.640109705125527e-286 < x < 1.7055115725639995e-66

    1. Initial program 6.5

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{y}{z}\right)}^{1}} \cdot {x}^{1} + \left(-\frac{t}{1 - z}\right) \cdot x\]
    8. Applied pow-prod-down6.5

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

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

      \[\leadsto {\left(\frac{x \cdot y}{z}\right)}^{1} + \left(-\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) \cdot x\]
    12. Applied distribute-lft-neg-in3.6

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

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

    if 1.7055115725639995e-66 < x

    1. Initial program 2.6

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{y}{z}\right)}^{1}} \cdot {x}^{1} + \left(-\frac{t}{1 - z}\right) \cdot x\]
    8. Applied pow-prod-down2.6

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

      \[\leadsto {\color{blue}{\left(\frac{x \cdot y}{z}\right)}}^{1} + \left(-\frac{t}{1 - z}\right) \cdot x\]
    10. Using strategy rm
    11. Applied associate-/l*2.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.2101704997358074 \cdot 10^{102}:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(-t\right) \cdot \frac{x}{1 - z}\\ \mathbf{elif}\;x \le -2.64010970512552713 \cdot 10^{-286}:\\ \;\;\;\;y \cdot \frac{x}{z} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \mathbf{elif}\;x \le 1.70551157256399953 \cdot 10^{-66}:\\ \;\;\;\;\left(-\sqrt[3]{\frac{t}{1 - z}} \cdot \sqrt[3]{\frac{t}{1 - z}}\right) \cdot \left(\sqrt[3]{\frac{t}{1 - z}} \cdot x\right) + \frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{t}{1 - z}\right) \cdot x + \frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

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

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

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