Average Error: 7.4 → 0.6
Time: 4.1s
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.21770722541850068 \cdot 10^{200} \lor \neg \left(x \cdot y - y \cdot z \le -5.3703905181517181 \cdot 10^{-145} \lor \neg \left(x \cdot y - y \cdot z \le 2.70424997808956203 \cdot 10^{-148}\right) \land x \cdot y - y \cdot z \le 6.534258241714583 \cdot 10^{301}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \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.21770722541850068 \cdot 10^{200} \lor \neg \left(x \cdot y - y \cdot z \le -5.3703905181517181 \cdot 10^{-145} \lor \neg \left(x \cdot y - y \cdot z \le 2.70424997808956203 \cdot 10^{-148}\right) \land x \cdot y - y \cdot z \le 6.534258241714583 \cdot 10^{301}\right):\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \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.217707225418501e+200) || !((((double) (((double) (x * y)) - ((double) (y * z)))) <= -5.370390518151718e-145) || (!(((double) (((double) (x * y)) - ((double) (y * z)))) <= 2.704249978089562e-148) && (((double) (((double) (x * y)) - ((double) (y * z)))) <= 6.534258241714583e+301))))) {
		VAR = ((double) (y * ((double) (t * ((double) (x - z))))));
	} else {
		VAR = ((double) (t * ((double) (y * ((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.4
Target3.4
Herbie0.6
\[\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 2 regimes
  2. if (- (* x y) (* z y)) < -3.21770722541850068e200 or -5.3703905181517181e-145 < (- (* x y) (* z y)) < 2.70424997808956203e-148 or 6.534258241714583e301 < (- (* x y) (* z y))

    1. Initial program 20.5

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

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

    if -3.21770722541850068e200 < (- (* x y) (* z y)) < -5.3703905181517181e-145 or 2.70424997808956203e-148 < (- (* x y) (* z y)) < 6.534258241714583e301

    1. Initial program 0.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.3

      \[\leadsto \left(x \cdot y - z \cdot y\right) \cdot \color{blue}{\left(1 \cdot t\right)}\]
    4. Applied associate-*r*0.3

      \[\leadsto \color{blue}{\left(\left(x \cdot y - z \cdot y\right) \cdot 1\right) \cdot t}\]
    5. Simplified0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - y \cdot z \le -3.21770722541850068 \cdot 10^{200} \lor \neg \left(x \cdot y - y \cdot z \le -5.3703905181517181 \cdot 10^{-145} \lor \neg \left(x \cdot y - y \cdot z \le 2.70424997808956203 \cdot 10^{-148}\right) \land x \cdot y - y \cdot z \le 6.534258241714583 \cdot 10^{301}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \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))