Average Error: 4.7 → 2.6
Time: 5.7s
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 -3.067010148751383039030641256737289935761 \cdot 10^{281} \lor \neg \left(\frac{y}{z} - \frac{t}{1 - z} \le 1.007109693799832358104777617759847004729 \cdot 10^{193}\right):\\ \;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}\right)\right) \cdot \sqrt[3]{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} \le -3.067010148751383039030641256737289935761 \cdot 10^{281} \lor \neg \left(\frac{y}{z} - \frac{t}{1 - z} \le 1.007109693799832358104777617759847004729 \cdot 10^{193}\right):\\
\;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r336068 = x;
        double r336069 = y;
        double r336070 = z;
        double r336071 = r336069 / r336070;
        double r336072 = t;
        double r336073 = 1.0;
        double r336074 = r336073 - r336070;
        double r336075 = r336072 / r336074;
        double r336076 = r336071 - r336075;
        double r336077 = r336068 * r336076;
        return r336077;
}

double f(double x, double y, double z, double t) {
        double r336078 = y;
        double r336079 = z;
        double r336080 = r336078 / r336079;
        double r336081 = t;
        double r336082 = 1.0;
        double r336083 = r336082 - r336079;
        double r336084 = r336081 / r336083;
        double r336085 = r336080 - r336084;
        double r336086 = -3.067010148751383e+281;
        bool r336087 = r336085 <= r336086;
        double r336088 = 1.0071096937998324e+193;
        bool r336089 = r336085 <= r336088;
        double r336090 = !r336089;
        bool r336091 = r336087 || r336090;
        double r336092 = x;
        double r336093 = r336078 * r336083;
        double r336094 = r336079 * r336081;
        double r336095 = r336093 - r336094;
        double r336096 = r336092 * r336095;
        double r336097 = r336079 * r336083;
        double r336098 = r336096 / r336097;
        double r336099 = r336092 * r336085;
        double r336100 = cbrt(r336099);
        double r336101 = cbrt(r336092);
        double r336102 = cbrt(r336085);
        double r336103 = r336101 * r336102;
        double r336104 = r336100 * r336103;
        double r336105 = r336104 * r336100;
        double r336106 = r336091 ? r336098 : r336105;
        return r336106;
}

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.7
Target4.4
Herbie2.6
\[\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))) < -3.067010148751383e+281 or 1.0071096937998324e+193 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 27.6

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

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

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

    if -3.067010148751383e+281 < (- (/ y z) (/ t (- 1.0 z))) < 1.0071096937998324e+193

    1. Initial program 1.3

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

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

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

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

Reproduce

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