Average Error: 27.1 → 20.0
Time: 6.3s
Precision: 64
\[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
\[\begin{array}{l} \mathbf{if}\;y \le -8.528825256271354 \cdot 10^{156}:\\ \;\;\;\;z - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \mathbf{elif}\;y \le -2.61898695225493992 \cdot 10^{39}:\\ \;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \mathbf{elif}\;y \le -95783751222.018585:\\ \;\;\;\;z - \frac{y \cdot b}{\left(x + t\right) + y}\\ \mathbf{elif}\;y \le 4.96969925851830412 \cdot 10^{111}:\\ \;\;\;\;\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{\left(x + t\right) + y}\\ \mathbf{elif}\;y \le 5.2947219811442057 \cdot 10^{185}:\\ \;\;\;\;z - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \mathbf{elif}\;y \le 1.1491718325649683 \cdot 10^{285}:\\ \;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\ \mathbf{else}:\\ \;\;\;\;z - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \end{array}\]
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\begin{array}{l}
\mathbf{if}\;y \le -8.528825256271354 \cdot 10^{156}:\\
\;\;\;\;z - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\

\mathbf{elif}\;y \le -2.61898695225493992 \cdot 10^{39}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\

\mathbf{elif}\;y \le -95783751222.018585:\\
\;\;\;\;z - \frac{y \cdot b}{\left(x + t\right) + y}\\

\mathbf{elif}\;y \le 4.96969925851830412 \cdot 10^{111}:\\
\;\;\;\;\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{\left(x + t\right) + y}\\

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

\mathbf{elif}\;y \le 1.1491718325649683 \cdot 10^{285}:\\
\;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\

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

\end{array}
double code(double x, double y, double z, double t, double a, double b) {
	return ((double) (((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (t + y)) * a)))) - ((double) (y * b)))) / ((double) (((double) (x + t)) + y))));
}
double code(double x, double y, double z, double t, double a, double b) {
	double VAR;
	if ((y <= -8.528825256271354e+156)) {
		VAR = ((double) (z - ((double) (((double) (y / ((double) (((double) cbrt(((double) (((double) (x + t)) + y)))) * ((double) cbrt(((double) (((double) (x + t)) + y)))))))) * ((double) (b / ((double) cbrt(((double) (((double) (x + t)) + y))))))))));
	} else {
		double VAR_1;
		if ((y <= -2.61898695225494e+39)) {
			VAR_1 = ((double) (((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (t + y)) * a)))) / ((double) (((double) (x + t)) + y)))) - ((double) (((double) (y / ((double) (((double) cbrt(((double) (((double) (x + t)) + y)))) * ((double) cbrt(((double) (((double) (x + t)) + y)))))))) * ((double) (b / ((double) cbrt(((double) (((double) (x + t)) + y))))))))));
		} else {
			double VAR_2;
			if ((y <= -95783751222.01859)) {
				VAR_2 = ((double) (z - ((double) (((double) (y * b)) / ((double) (((double) (x + t)) + y))))));
			} else {
				double VAR_3;
				if ((y <= 4.969699258518304e+111)) {
					VAR_3 = ((double) (((double) (((double) (((double) (((double) (x + y)) * z)) + ((double) (((double) (t + y)) * a)))) - ((double) (y * b)))) * ((double) (1.0 / ((double) (((double) (x + t)) + y))))));
				} else {
					double VAR_4;
					if ((y <= 5.2947219811442057e+185)) {
						VAR_4 = ((double) (z - ((double) (((double) (y / ((double) (((double) cbrt(((double) (((double) (x + t)) + y)))) * ((double) cbrt(((double) (((double) (x + t)) + y)))))))) * ((double) (b / ((double) cbrt(((double) (((double) (x + t)) + y))))))))));
					} else {
						double VAR_5;
						if ((y <= 1.1491718325649683e+285)) {
							VAR_5 = ((double) (a - ((double) (y * ((double) (b / ((double) (((double) (x + t)) + y))))))));
						} else {
							VAR_5 = ((double) (z - ((double) (((double) (y / ((double) (((double) cbrt(((double) (((double) (x + t)) + y)))) * ((double) cbrt(((double) (((double) (x + t)) + y)))))))) * ((double) (b / ((double) cbrt(((double) (((double) (x + t)) + y))))))))));
						}
						VAR_4 = VAR_5;
					}
					VAR_3 = VAR_4;
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original27.1
Target11.4
Herbie20.0
\[\begin{array}{l} \mathbf{if}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \lt -3.5813117084150564 \cdot 10^{153}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \lt 1.2285964308315609 \cdot 10^{82}:\\ \;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array}\]

Derivation

  1. Split input into 5 regimes
  2. if y < -8.528825256271354e+156 or 4.969699258518304e+111 < y < 5.2947219811442057e+185 or 1.1491718325649683e+285 < y

    1. Initial program 47.2

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Using strategy rm
    3. Applied div-sub47.2

      \[\leadsto \color{blue}{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\left(x + t\right) + y}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt47.3

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\color{blue}{\left(\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}\right) \cdot \sqrt[3]{\left(x + t\right) + y}}}\]
    6. Applied times-frac38.2

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{\frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}}\]
    7. Taylor expanded around inf 23.8

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

    if -8.528825256271354e+156 < y < -2.61898695225494e+39

    1. Initial program 30.9

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Using strategy rm
    3. Applied div-sub30.9

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

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\color{blue}{\left(\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}\right) \cdot \sqrt[3]{\left(x + t\right) + y}}}\]
    6. Applied times-frac25.2

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

    if -2.61898695225494e+39 < y < -95783751222.01859

    1. Initial program 19.1

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

      \[\leadsto \color{blue}{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\left(x + t\right) + y}}\]
    4. Taylor expanded around inf 34.4

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

    if -95783751222.01859 < y < 4.969699258518304e+111

    1. Initial program 16.8

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Using strategy rm
    3. Applied div-inv16.9

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

    if 5.2947219811442057e+185 < y < 1.1491718325649683e+285

    1. Initial program 50.1

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

      \[\leadsto \color{blue}{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y \cdot b}{\left(x + t\right) + y}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity50.1

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

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

      \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y} \cdot \frac{b}{\left(x + t\right) + y}\]
    8. Taylor expanded around 0 23.3

      \[\leadsto \color{blue}{a} - y \cdot \frac{b}{\left(x + t\right) + y}\]
  3. Recombined 5 regimes into one program.
  4. Final simplification20.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -8.528825256271354 \cdot 10^{156}:\\ \;\;\;\;z - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \mathbf{elif}\;y \le -2.61898695225493992 \cdot 10^{39}:\\ \;\;\;\;\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \mathbf{elif}\;y \le -95783751222.018585:\\ \;\;\;\;z - \frac{y \cdot b}{\left(x + t\right) + y}\\ \mathbf{elif}\;y \le 4.96969925851830412 \cdot 10^{111}:\\ \;\;\;\;\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right) \cdot \frac{1}{\left(x + t\right) + y}\\ \mathbf{elif}\;y \le 5.2947219811442057 \cdot 10^{185}:\\ \;\;\;\;z - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \mathbf{elif}\;y \le 1.1491718325649683 \cdot 10^{285}:\\ \;\;\;\;a - y \cdot \frac{b}{\left(x + t\right) + y}\\ \mathbf{else}:\\ \;\;\;\;z - \frac{y}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} \cdot \frac{b}{\sqrt[3]{\left(x + t\right) + y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020124 
(FPCore (x y z t a b)
  :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
  :precision binary64

  :herbie-target
  (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))

  (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))