Average Error: 4.5 → 2.9
Time: 9.3s
Precision: 64
\[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
\[\begin{array}{l} \mathbf{if}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) = -\infty:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \sqrt[3]{1 - z} - z \cdot \left(\left(t \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)}{z \cdot \sqrt[3]{1 - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ \end{array}\]
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\begin{array}{l}
\mathbf{if}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) = -\infty:\\
\;\;\;\;\frac{x \cdot \left(y \cdot \sqrt[3]{1 - z} - z \cdot \left(\left(t \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)}{z \cdot \sqrt[3]{1 - z}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r271950 = x;
        double r271951 = y;
        double r271952 = z;
        double r271953 = r271951 / r271952;
        double r271954 = t;
        double r271955 = 1.0;
        double r271956 = r271955 - r271952;
        double r271957 = r271954 / r271956;
        double r271958 = r271953 - r271957;
        double r271959 = r271950 * r271958;
        return r271959;
}

double f(double x, double y, double z, double t) {
        double r271960 = x;
        double r271961 = y;
        double r271962 = z;
        double r271963 = r271961 / r271962;
        double r271964 = t;
        double r271965 = 1.0;
        double r271966 = r271965 - r271962;
        double r271967 = r271964 / r271966;
        double r271968 = r271963 - r271967;
        double r271969 = r271960 * r271968;
        double r271970 = -inf.0;
        bool r271971 = r271969 <= r271970;
        double r271972 = cbrt(r271966);
        double r271973 = r271961 * r271972;
        double r271974 = 1.0;
        double r271975 = cbrt(r271974);
        double r271976 = r271974 / r271966;
        double r271977 = cbrt(r271976);
        double r271978 = r271975 * r271977;
        double r271979 = r271964 * r271978;
        double r271980 = r271979 * r271977;
        double r271981 = r271962 * r271980;
        double r271982 = r271973 - r271981;
        double r271983 = r271960 * r271982;
        double r271984 = r271962 * r271972;
        double r271985 = r271983 / r271984;
        double r271986 = r271964 * r271976;
        double r271987 = r271963 - r271986;
        double r271988 = r271960 * r271987;
        double r271989 = r271971 ? r271985 : r271988;
        return r271989;
}

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.5
Target4.1
Herbie2.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 (* x (- (/ y z) (/ t (- 1.0 z)))) < -inf.0

    1. Initial program 64.0

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

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

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

      \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot \left(\sqrt[3]{\frac{1}{1 - z}} \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right) \cdot \sqrt[3]{\frac{1}{1 - z}}}\right)\]
    7. Using strategy rm
    8. Applied cbrt-div64.0

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

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

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

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

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

    if -inf.0 < (* x (- (/ y z) (/ t (- 1.0 z))))

    1. Initial program 3.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) = -\infty:\\ \;\;\;\;\frac{x \cdot \left(y \cdot \sqrt[3]{1 - z} - z \cdot \left(\left(t \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right) \cdot \sqrt[3]{\frac{1}{1 - z}}\right)\right)}{z \cdot \sqrt[3]{1 - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ \end{array}\]

Reproduce

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