Average Error: 7.7 → 1.4
Time: 4.3s
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)))) <= -1.42775779055872e+62)) {
		VAR = ((double) (((double) (y * t)) * ((double) (x - z))));
	} else {
		double VAR_1;
		if (((((double) (((double) (x * y)) - ((double) (y * z)))) <= -6.280109219211096e-183) || (!(((double) (((double) (x * y)) - ((double) (y * z)))) <= 3.41418453750115e-310) && (((double) (((double) (x * y)) - ((double) (y * z)))) <= 2.8361109287185316e+217)))) {
			VAR_1 = ((double) (((double) (((double) (x * y)) - ((double) (y * z)))) * t));
		} else {
			VAR_1 = ((double) (y * ((double) (((double) (x * t)) - ((double) (z * t))))));
		}
		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.7
Target3.0
Herbie1.4
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (- (* x y) (* z y)) < -1.42775779055872e62

    1. Initial program 14.0

      \[\]
    2. Simplified5.0

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

      \[\leadsto \]

    if -1.42775779055872e62 < (- (* x y) (* z y)) < -6.2801092192110957e-183 or 3.414184537501145e-310 < (- (* x y) (* z y)) < 2.8361109287185316e217

    1. Initial program 0.3

      \[\]

    if -6.2801092192110957e-183 < (- (* x y) (* z y)) < 3.414184537501145e-310 or 2.8361109287185316e217 < (- (* x y) (* z y))

    1. Initial program 21.8

      \[\]
    2. Simplified1.2

      \[\leadsto \]
    3. Using strategy rm
    4. Applied sub-neg1.2

      \[\leadsto \]
    5. Applied distribute-lft-in1.2

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

    \[\leadsto \]

Reproduce

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