Average Error: 26.4 → 21.2
Time: 15.5s
Precision: binary64
\[\]
\[\]
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 <= -3.9514440104654884e+284)) {
		VAR = z;
	} else {
		double VAR_1;
		if (((y <= -8.76659832826979e+27) || !(y <= 7.162801348193014e+141))) {
			VAR_1 = ((double) (a - ((double) (y * ((double) (b / ((double) (x + ((double) (y + t))))))))));
		} else {
			VAR_1 = ((double) (((double) cbrt(((double) (((double) (((double) (z * ((double) (y + x)))) + ((double) (((double) (a * t)) + ((double) (y * ((double) (a - b)))))))) / ((double) (x + ((double) (y + t)))))))) * ((double) (((double) cbrt(((double) (((double) (((double) (z * ((double) (y + x)))) + ((double) (((double) (a * t)) + ((double) (y * ((double) (a - b)))))))) / ((double) (x + ((double) (y + t)))))))) * ((double) cbrt(((double) (((double) (((double) (z * ((double) (y + x)))) + ((double) (((double) (a * t)) + ((double) (y * ((double) (a - b)))))))) / ((double) (x + ((double) (y + t))))))))))));
		}
		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

Original26.4
Target10.9
Herbie21.2
\[\]

Derivation

  1. Split input into 3 regimes
  2. if y < -3.95144401046548844e284

    1. Initial program 54.3

      \[\]
    2. Taylor expanded around inf 46.8

      \[\leadsto \]

    if -3.95144401046548844e284 < y < -8.7665983282697901e27 or 7.16280134819301382e141 < y

    1. Initial program 42.2

      \[\]
    2. Using strategy rm
    3. Applied div-sub42.2

      \[\leadsto \]
    4. Simplified42.2

      \[\leadsto \]
    5. Simplified34.6

      \[\leadsto \]
    6. Taylor expanded around 0 25.8

      \[\leadsto \]

    if -8.7665983282697901e27 < y < 7.16280134819301382e141

    1. Initial program 17.0

      \[\]
    2. Using strategy rm
    3. Applied add-cube-cbrt17.9

      \[\leadsto \]
    4. Simplified17.8

      \[\leadsto \]
    5. Simplified17.8

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification21.2

    \[\leadsto \]

Reproduce

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