Average Error: 7.3 → 0.7
Time: 3.9s
Precision: binary64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - y \cdot z \le -3.113629020948064 \cdot 10^{162}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \le -3.10010569895846481 \cdot 10^{-225}:\\ \;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\ \mathbf{elif}\;x \cdot y - y \cdot z \le 6.33157601097247731 \cdot 10^{-204}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \le 2.0078060847257609 \cdot 10^{203}:\\ \;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - y \cdot z \le -3.113629020948064 \cdot 10^{162}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

\mathbf{elif}\;x \cdot y - y \cdot z \le -3.10010569895846481 \cdot 10^{-225}:\\
\;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\

\mathbf{elif}\;x \cdot y - y \cdot z \le 6.33157601097247731 \cdot 10^{-204}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;x \cdot y - y \cdot z \le 2.0078060847257609 \cdot 10^{203}:\\
\;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

\end{array}
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
\[\begin{array}{l} \mathbf{if}\;t \lt -9.2318795828867769 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.5430670515648771 \cdot 10^{83}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]

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

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified1.8

      \[\leadsto \color{blue}{y \cdot \left(t \cdot \left(x - z\right)\right)}\]

    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

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]

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

    1. Initial program 9.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified0.7

      \[\leadsto \color{blue}{y \cdot \left(t \cdot \left(x - z\right)\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*0.7

      \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot \left(x - z\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - y \cdot z \le -3.113629020948064 \cdot 10^{162}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \le -3.10010569895846481 \cdot 10^{-225}:\\ \;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\ \mathbf{elif}\;x \cdot y - y \cdot z \le 6.33157601097247731 \cdot 10^{-204}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \le 2.0078060847257609 \cdot 10^{203}:\\ \;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]

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))