Average Error: 6.9 → 1.8
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.933866296456802e+112) || !(((double) (((double) (x * y)) - ((double) (y * z)))) <= 1.291662991304747e+223))) {
		VAR = ((double) (((double) (y * t)) * ((double) (x - z))));
	} else {
		VAR = ((double) (((double) (((double) (x * y)) - ((double) (y * z)))) * t));
	}
	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

Original6.9
Target3.1
Herbie1.8
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (- (* x y) (* z y)) < -3.93386629645680209e112 or 1.29166299130474691e223 < (- (* x y) (* z y))

    1. Initial program 22.2

      \[\]
    2. Simplified3.0

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

      \[\leadsto \]

    if -3.93386629645680209e112 < (- (* x y) (* z y)) < 1.29166299130474691e223

    1. Initial program 1.6

      \[\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.8

    \[\leadsto \]

Reproduce

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