Average Error: 25.9 → 19.2
Time: 10.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}\;a \le -8.06477244056901117 \cdot 10^{156}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \le 2.45442140322551004 \cdot 10^{170}:\\ \;\;\;\;1 \cdot \left(\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{b}{\frac{\left(x + t\right) + y}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;a\\ \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}\;a \le -8.06477244056901117 \cdot 10^{156}:\\
\;\;\;\;a\\

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

\mathbf{else}:\\
\;\;\;\;a\\

\end{array}
double code(double x, double y, double z, double t, double a, double b) {
	return (((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y));
}
double code(double x, double y, double z, double t, double a, double b) {
	double temp;
	if ((a <= -8.064772440569011e+156)) {
		temp = a;
	} else {
		double temp_1;
		if ((a <= 2.45442140322551e+170)) {
			temp_1 = (1.0 * (((((x + y) * z) + ((t + y) * a)) / ((x + t) + y)) - (b / (((x + t) + y) / y))));
		} else {
			temp_1 = a;
		}
		temp = temp_1;
	}
	return temp;
}

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

Original25.9
Target11.1
Herbie19.2
\[\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 2 regimes
  2. if a < -8.064772440569011e+156 or 2.45442140322551e+170 < a

    1. Initial program 42.5

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\]
    2. Taylor expanded around 0 25.9

      \[\leadsto \color{blue}{a}\]

    if -8.064772440569011e+156 < a < 2.45442140322551e+170

    1. Initial program 20.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-inv20.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}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity20.9

      \[\leadsto \color{blue}{\left(1 \cdot \left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)} \cdot \frac{1}{\left(x + t\right) + y}\]
    6. Applied associate-*l*20.9

      \[\leadsto \color{blue}{1 \cdot \left(\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}\right)}\]
    7. Simplified20.8

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

      \[\leadsto 1 \cdot \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - 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}}}\]
    10. Applied associate-/r*21.5

      \[\leadsto 1 \cdot \color{blue}{\frac{\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}}}{\sqrt[3]{\left(x + t\right) + y}}}\]
    11. Using strategy rm
    12. Applied div-sub21.5

      \[\leadsto 1 \cdot \frac{\color{blue}{\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}} - \frac{y \cdot b}{\sqrt[3]{\left(x + t\right) + y} \cdot \sqrt[3]{\left(x + t\right) + y}}}}{\sqrt[3]{\left(x + t\right) + y}}\]
    13. Applied div-sub21.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -8.06477244056901117 \cdot 10^{156}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \le 2.45442140322551004 \cdot 10^{170}:\\ \;\;\;\;1 \cdot \left(\frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \frac{b}{\frac{\left(x + t\right) + y}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array}\]

Reproduce

herbie shell --seed 2020053 
(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 (/ (+ (+ 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)))