Average Error: 7.5 → 0.5
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)))) <= -3.810336446111579e+231) || !((((double) (((double) (x * y)) - ((double) (y * z)))) <= -1.816799297716596e-290) || (!(((double) (((double) (x * y)) - ((double) (y * z)))) <= 0.0) && (((double) (((double) (x * y)) - ((double) (y * z)))) <= 7.790056788598872e+187))))) {
		VAR = ((double) (y * ((double) (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

Original7.5
Target3.1
Herbie0.5
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (- (* x y) (* z y)) < -3.81033644611157888e231 or -1.8167992977165959e-290 < (- (* x y) (* z y)) < 0.0 or 7.79005678859887208e187 < (- (* x y) (* z y))

    1. Initial program 27.6

      \[\]
    2. Simplified1.0

      \[\leadsto \]

    if -3.81033644611157888e231 < (- (* x y) (* z y)) < -1.8167992977165959e-290 or 0.0 < (- (* x y) (* z y)) < 7.79005678859887208e187

    1. Initial program 0.3

      \[\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \]

Reproduce

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