Average Error: 4.9 → 6.3
Time: 13.3s
Precision: 64
\[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.699374283935706957857036182841032710783 \cdot 10^{-111}:\\ \;\;\;\;\left(-\frac{x}{1 - z} \cdot t\right) + \frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;t \le -5.007773027212033065092460998980032370379 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\frac{\sqrt[3]{z}}{y}} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \mathbf{elif}\;t \le 2.908173716702790308007991050967572224611 \cdot 10^{-176}:\\ \;\;\;\;\left(-\frac{x}{1 - z} \cdot t\right) + \frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;t \le 1.718971399470042797796034795368720912003 \cdot 10^{77} \lor \neg \left(t \le 2.558763577632535082751983059244934102411 \cdot 10^{144}\right):\\ \;\;\;\;x \cdot \frac{y}{z} + x \cdot \left(t \cdot \frac{-1}{1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z} + \frac{\left(-t\right) \cdot x}{1 - z}\\ \end{array}\]
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\begin{array}{l}
\mathbf{if}\;t \le -1.699374283935706957857036182841032710783 \cdot 10^{-111}:\\
\;\;\;\;\left(-\frac{x}{1 - z} \cdot t\right) + \frac{1}{\frac{z}{x \cdot y}}\\

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

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

\mathbf{elif}\;t \le 1.718971399470042797796034795368720912003 \cdot 10^{77} \lor \neg \left(t \le 2.558763577632535082751983059244934102411 \cdot 10^{144}\right):\\
\;\;\;\;x \cdot \frac{y}{z} + x \cdot \left(t \cdot \frac{-1}{1 - z}\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r279726 = x;
        double r279727 = y;
        double r279728 = z;
        double r279729 = r279727 / r279728;
        double r279730 = t;
        double r279731 = 1.0;
        double r279732 = r279731 - r279728;
        double r279733 = r279730 / r279732;
        double r279734 = r279729 - r279733;
        double r279735 = r279726 * r279734;
        return r279735;
}

double f(double x, double y, double z, double t) {
        double r279736 = t;
        double r279737 = -1.699374283935707e-111;
        bool r279738 = r279736 <= r279737;
        double r279739 = x;
        double r279740 = 1.0;
        double r279741 = z;
        double r279742 = r279740 - r279741;
        double r279743 = r279739 / r279742;
        double r279744 = r279743 * r279736;
        double r279745 = -r279744;
        double r279746 = 1.0;
        double r279747 = y;
        double r279748 = r279739 * r279747;
        double r279749 = r279741 / r279748;
        double r279750 = r279746 / r279749;
        double r279751 = r279745 + r279750;
        double r279752 = -5.007773027212033e-202;
        bool r279753 = r279736 <= r279752;
        double r279754 = cbrt(r279741);
        double r279755 = r279754 * r279754;
        double r279756 = r279739 / r279755;
        double r279757 = r279754 / r279747;
        double r279758 = r279756 / r279757;
        double r279759 = r279736 / r279742;
        double r279760 = -r279759;
        double r279761 = r279760 * r279739;
        double r279762 = r279758 + r279761;
        double r279763 = 2.9081737167027903e-176;
        bool r279764 = r279736 <= r279763;
        double r279765 = 1.7189713994700428e+77;
        bool r279766 = r279736 <= r279765;
        double r279767 = 2.558763577632535e+144;
        bool r279768 = r279736 <= r279767;
        double r279769 = !r279768;
        bool r279770 = r279766 || r279769;
        double r279771 = r279747 / r279741;
        double r279772 = r279739 * r279771;
        double r279773 = -1.0;
        double r279774 = r279773 / r279742;
        double r279775 = r279736 * r279774;
        double r279776 = r279739 * r279775;
        double r279777 = r279772 + r279776;
        double r279778 = r279748 / r279741;
        double r279779 = -r279736;
        double r279780 = r279779 * r279739;
        double r279781 = r279780 / r279742;
        double r279782 = r279778 + r279781;
        double r279783 = r279770 ? r279777 : r279782;
        double r279784 = r279764 ? r279751 : r279783;
        double r279785 = r279753 ? r279762 : r279784;
        double r279786 = r279738 ? r279751 : r279785;
        return r279786;
}

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.9
Target4.5
Herbie6.3
\[\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 4 regimes
  2. if t < -1.699374283935707e-111 or -5.007773027212033e-202 < t < 2.9081737167027903e-176

    1. Initial program 5.1

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot y}}} + \left(-\frac{t}{1 - z}\right) \cdot x\]
    9. Using strategy rm
    10. Applied *-un-lft-identity5.1

      \[\leadsto \frac{1}{\frac{z}{x \cdot y}} + \left(-\frac{t}{\color{blue}{1 \cdot \left(1 - z\right)}}\right) \cdot x\]
    11. Applied *-un-lft-identity5.1

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

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

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

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

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

    if -1.699374283935707e-111 < t < -5.007773027212033e-202

    1. Initial program 5.5

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

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

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

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

      \[\leadsto \frac{x \cdot y}{z} + \color{blue}{\left(-\frac{t}{1 - z}\right) \cdot x}\]
    7. Using strategy rm
    8. Applied clear-num7.4

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

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

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

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

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

    if 2.9081737167027903e-176 < t < 1.7189713994700428e+77 or 2.558763577632535e+144 < t

    1. Initial program 4.7

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{z} + \left(-\color{blue}{t \cdot \frac{1}{1 - z}}\right) \cdot x\]
    9. Using strategy rm
    10. Applied *-un-lft-identity4.7

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

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

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

    if 1.7189713994700428e+77 < t < 2.558763577632535e+144

    1. Initial program 3.8

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

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

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

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

      \[\leadsto \frac{x \cdot y}{z} + \color{blue}{\left(-\frac{t}{1 - z}\right) \cdot x}\]
    7. Using strategy rm
    8. Applied distribute-neg-frac4.0

      \[\leadsto \frac{x \cdot y}{z} + \color{blue}{\frac{-t}{1 - z}} \cdot x\]
    9. Applied associate-*l/8.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.699374283935706957857036182841032710783 \cdot 10^{-111}:\\ \;\;\;\;\left(-\frac{x}{1 - z} \cdot t\right) + \frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;t \le -5.007773027212033065092460998980032370379 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\frac{\sqrt[3]{z}}{y}} + \left(-\frac{t}{1 - z}\right) \cdot x\\ \mathbf{elif}\;t \le 2.908173716702790308007991050967572224611 \cdot 10^{-176}:\\ \;\;\;\;\left(-\frac{x}{1 - z} \cdot t\right) + \frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;t \le 1.718971399470042797796034795368720912003 \cdot 10^{77} \lor \neg \left(t \le 2.558763577632535082751983059244934102411 \cdot 10^{144}\right):\\ \;\;\;\;x \cdot \frac{y}{z} + x \cdot \left(t \cdot \frac{-1}{1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z} + \frac{\left(-t\right) \cdot x}{1 - z}\\ \end{array}\]

Reproduce

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