Average Error: 4.9 → 1.5
Time: 5.5s
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} = -\infty \lor \neg \left(\frac{y}{z} - \frac{t}{1 - z} \le 4.071156994590675814961087478639352093597 \cdot 10^{242}\right):\\ \;\;\;\;\frac{x \cdot \left(y \cdot \left(\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}\right) - z \cdot \left(1 \cdot \frac{t}{\sqrt[3]{1 - z}}\right)\right)}{z \cdot \left(\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - \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} = -\infty \lor \neg \left(\frac{y}{z} - \frac{t}{1 - z} \le 4.071156994590675814961087478639352093597 \cdot 10^{242}\right):\\
\;\;\;\;\frac{x \cdot \left(y \cdot \left(\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}\right) - z \cdot \left(1 \cdot \frac{t}{\sqrt[3]{1 - z}}\right)\right)}{z \cdot \left(\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}\right)}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r462352 = x;
        double r462353 = y;
        double r462354 = z;
        double r462355 = r462353 / r462354;
        double r462356 = t;
        double r462357 = 1.0;
        double r462358 = r462357 - r462354;
        double r462359 = r462356 / r462358;
        double r462360 = r462355 - r462359;
        double r462361 = r462352 * r462360;
        return r462361;
}

double f(double x, double y, double z, double t) {
        double r462362 = y;
        double r462363 = z;
        double r462364 = r462362 / r462363;
        double r462365 = t;
        double r462366 = 1.0;
        double r462367 = r462366 - r462363;
        double r462368 = r462365 / r462367;
        double r462369 = r462364 - r462368;
        double r462370 = -inf.0;
        bool r462371 = r462369 <= r462370;
        double r462372 = 4.071156994590676e+242;
        bool r462373 = r462369 <= r462372;
        double r462374 = !r462373;
        bool r462375 = r462371 || r462374;
        double r462376 = x;
        double r462377 = cbrt(r462367);
        double r462378 = r462377 * r462377;
        double r462379 = r462362 * r462378;
        double r462380 = 1.0;
        double r462381 = r462365 / r462377;
        double r462382 = r462380 * r462381;
        double r462383 = r462363 * r462382;
        double r462384 = r462379 - r462383;
        double r462385 = r462376 * r462384;
        double r462386 = r462363 * r462378;
        double r462387 = r462385 / r462386;
        double r462388 = r462376 * r462369;
        double r462389 = r462375 ? r462387 : r462388;
        return r462389;
}

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.4
Herbie1.5
\[\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))) < -inf.0 or 4.071156994590676e+242 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 40.2

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

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

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

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

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

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

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

    if -inf.0 < (- (/ y z) (/ t (- 1.0 z))) < 4.071156994590676e+242

    1. Initial program 1.5

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

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

Reproduce

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