Average Error: 4.4 → 1.9
Time: 4.8s
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) \le 0.0:\\ \;\;\;\;\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}} + \frac{-x}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{t}{\sqrt[3]{1 - z}}\\ \mathbf{elif}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \le 1.3464474438162144 \cdot 10^{295}:\\ \;\;\;\;\sqrt{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}\\ \mathbf{else}:\\ \;\;\;\;\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}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \le 0.0:\\
\;\;\;\;\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}} + \frac{-x}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{t}{\sqrt[3]{1 - z}}\\

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

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z))))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))))) <= 0.0)) {
		VAR = ((double) (((double) (((double) (x * ((double) (((double) (((double) cbrt(y)) * ((double) cbrt(y)))) / ((double) (((double) cbrt(z)) * ((double) cbrt(z)))))))) * ((double) (((double) cbrt(y)) / ((double) cbrt(z)))))) + ((double) (((double) (((double) -(x)) / ((double) (((double) cbrt(((double) (1.0 - z)))) * ((double) cbrt(((double) (1.0 - z)))))))) * ((double) (t / ((double) cbrt(((double) (1.0 - z))))))))));
	} else {
		double VAR_1;
		if ((((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))))) <= 1.3464474438162144e+295)) {
			VAR_1 = ((double) (((double) sqrt(((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))))))) * ((double) sqrt(((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z))))))))))));
		} else {
			VAR_1 = ((double) (((double) (x * ((double) (((double) (y * ((double) (1.0 - z)))) - ((double) (z * t)))))) / ((double) (z * ((double) (1.0 - z))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.4
Target4.1
Herbie1.9
\[\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 (* x (- (/ y z) (/ t (- 1.0 z)))) < 0.0

    1. Initial program 4.8

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{y}{z} + \color{blue}{\frac{-x}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}}} \cdot \frac{t}{\sqrt[3]{1 - z}}\]
    12. Using strategy rm
    13. Applied add-cube-cbrt5.9

      \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} + \frac{-x}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{t}{\sqrt[3]{1 - z}}\]
    14. Applied add-cube-cbrt6.0

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

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

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

    if 0.0 < (* x (- (/ y z) (/ t (- 1.0 z)))) < 1.3464474438162144e+295

    1. Initial program 0.3

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

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

    if 1.3464474438162144e+295 < (* x (- (/ y z) (/ t (- 1.0 z))))

    1. Initial program 52.9

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

      \[\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.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \le 0.0:\\ \;\;\;\;\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}} + \frac{-x}{\sqrt[3]{1 - z} \cdot \sqrt[3]{1 - z}} \cdot \frac{t}{\sqrt[3]{1 - z}}\\ \mathbf{elif}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \le 1.3464474438162144 \cdot 10^{295}:\\ \;\;\;\;\sqrt{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)} \cdot \sqrt{x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)}\\ \mathbf{else}:\\ \;\;\;\;\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 2020122 
(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)))))