Average Error: 7.3 → 0.7
Time: 4.1s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (((double) (((double) (x * y)) - ((double) (z * y)))) * t));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((double) (((double) (x * y)) - ((double) (y * z)))) <= -3.1136290209480643e+162)) {
		VAR = ((double) (y * ((double) (t * ((double) (x - z))))));
	} else {
		double VAR_1;
		if ((((double) (((double) (x * y)) - ((double) (y * z)))) <= -3.100105698958465e-225)) {
			VAR_1 = ((double) (((double) (((double) (x * y)) - ((double) (y * z)))) * t));
		} else {
			double VAR_2;
			if ((((double) (((double) (x * y)) - ((double) (y * z)))) <= 6.331576010972477e-204)) {
				VAR_2 = ((double) (((double) (x - z)) * ((double) (y * t))));
			} else {
				double VAR_3;
				if ((((double) (((double) (x * y)) - ((double) (y * z)))) <= 2.007806084725761e+203)) {
					VAR_3 = ((double) (((double) (((double) (x * y)) - ((double) (y * z)))) * t));
				} else {
					VAR_3 = ((double) (y * ((double) (t * ((double) (x - z))))));
				}
				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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.3
Target3.0
Herbie0.7
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (- (* x y) (* z y)) < -3.113629020948064e162 or 2.0078060847257609e203 < (- (* x y) (* z y))

    1. Initial program 25.2

      \[\]
    2. Simplified1.8

      \[\leadsto \]

    if -3.113629020948064e162 < (- (* x y) (* z y)) < -3.10010569895846481e-225 or 6.33157601097247731e-204 < (- (* x y) (* z y)) < 2.0078060847257609e203

    1. Initial program 0.2

      \[\]

    if -3.10010569895846481e-225 < (- (* x y) (* z y)) < 6.33157601097247731e-204

    1. Initial program 9.7

      \[\]
    2. Simplified0.7

      \[\leadsto \]
    3. Using strategy rm
    4. Applied associate-*r*0.7

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))

  (* (- (* x y) (* z y)) t))