Average Error: 4.8 → 0.3
Time: 4.9s
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.2592621423955549 \cdot 10^{306}:\\ \;\;\;\;1 \cdot \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.9384031107510682 \cdot 10^{-253}:\\ \;\;\;\;1 \cdot \left(x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le -0.0:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(1 \cdot \frac{t \cdot x}{{z}^{2}} + \frac{t \cdot x}{z}\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 6.2094051295440155 \cdot 10^{253}:\\ \;\;\;\;1 \cdot \left(x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(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.2592621423955549 \cdot 10^{306}:\\
\;\;\;\;1 \cdot \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.9384031107510682 \cdot 10^{-253}:\\
\;\;\;\;1 \cdot \left(x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\right)\\

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r435822 = x;
        double r435823 = y;
        double r435824 = z;
        double r435825 = r435823 / r435824;
        double r435826 = t;
        double r435827 = 1.0;
        double r435828 = r435827 - r435824;
        double r435829 = r435826 / r435828;
        double r435830 = r435825 - r435829;
        double r435831 = r435822 * r435830;
        return r435831;
}

double f(double x, double y, double z, double t) {
        double r435832 = y;
        double r435833 = z;
        double r435834 = r435832 / r435833;
        double r435835 = t;
        double r435836 = 1.0;
        double r435837 = r435836 - r435833;
        double r435838 = r435835 / r435837;
        double r435839 = r435834 - r435838;
        double r435840 = -2.259262142395555e+306;
        bool r435841 = r435839 <= r435840;
        double r435842 = 1.0;
        double r435843 = x;
        double r435844 = r435832 * r435837;
        double r435845 = r435833 * r435835;
        double r435846 = r435844 - r435845;
        double r435847 = r435843 * r435846;
        double r435848 = r435833 * r435837;
        double r435849 = r435847 / r435848;
        double r435850 = r435842 * r435849;
        double r435851 = -6.938403110751068e-253;
        bool r435852 = r435839 <= r435851;
        double r435853 = r435843 * r435839;
        double r435854 = r435842 * r435853;
        double r435855 = -0.0;
        bool r435856 = r435839 <= r435855;
        double r435857 = r435843 * r435832;
        double r435858 = r435857 / r435833;
        double r435859 = r435835 * r435843;
        double r435860 = 2.0;
        double r435861 = pow(r435833, r435860);
        double r435862 = r435859 / r435861;
        double r435863 = r435836 * r435862;
        double r435864 = r435859 / r435833;
        double r435865 = r435863 + r435864;
        double r435866 = r435858 + r435865;
        double r435867 = 6.209405129544016e+253;
        bool r435868 = r435839 <= r435867;
        double r435869 = r435868 ? r435854 : r435850;
        double r435870 = r435856 ? r435866 : r435869;
        double r435871 = r435852 ? r435854 : r435870;
        double r435872 = r435841 ? r435850 : r435871;
        return r435872;
}

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.3
Herbie0.3
\[\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))) < -2.259262142395555e+306 or 6.209405129544016e+253 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 43.9

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

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

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

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

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

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

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

    if -2.259262142395555e+306 < (- (/ y z) (/ t (- 1.0 z))) < -6.938403110751068e-253 or -0.0 < (- (/ y z) (/ t (- 1.0 z))) < 6.209405129544016e+253

    1. Initial program 0.3

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

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

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

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

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

    if -6.938403110751068e-253 < (- (/ y z) (/ t (- 1.0 z))) < -0.0

    1. Initial program 16.0

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

      \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{t \cdot \frac{1}{1 - z}}\right)\]
    4. Taylor expanded around inf 0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le -2.2592621423955549 \cdot 10^{306}:\\ \;\;\;\;1 \cdot \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.9384031107510682 \cdot 10^{-253}:\\ \;\;\;\;1 \cdot \left(x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le -0.0:\\ \;\;\;\;\frac{x \cdot y}{z} + \left(1 \cdot \frac{t \cdot x}{{z}^{2}} + \frac{t \cdot x}{z}\right)\\ \mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 6.2094051295440155 \cdot 10^{253}:\\ \;\;\;\;1 \cdot \left(x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\ \end{array}\]

Reproduce

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