Average Error: 7.5 → 3.3
Time: 3.8s
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 (((t <= -1.1067936186022065e+129) || !(t <= 1.3231564757824707e-45))) {
		VAR = ((double) (t * ((double) (((double) (x * y)) - ((double) (y * z))))));
	} else {
		VAR = ((double) (y * ((double) (t * ((double) (x - z))))));
	}
	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.0
Herbie3.3
\[\]

Derivation

  1. Split input into 2 regimes
  2. if t < -1.10679361860220652e129 or 1.3231564757824707e-45 < t

    1. Initial program 3.5

      \[\]

    if -1.10679361860220652e129 < t < 1.3231564757824707e-45

    1. Initial program 9.4

      \[\]
    2. Simplified3.2

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

    \[\leadsto \]

Reproduce

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