Average Error: 6.9 → 0.5
Time: 7.9min
Precision: binary64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -5.62056246049488059 \cdot 10^{171}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.0135363704689411 \cdot 10^{-187}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 4.81516 \cdot 10^{-320}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.04309193842541907 \cdot 10^{285}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -5.62056246049488059 \cdot 10^{171}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\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) (z * y)))) <= -5.620562460494881e+171)) {
		VAR = ((double) (((double) (t * y)) * ((double) (x - z))));
	} else {
		double VAR_1;
		if ((((double) (((double) (x * y)) - ((double) (z * y)))) <= -4.013536370468941e-187)) {
			VAR_1 = ((double) (((double) (((double) (x * y)) - ((double) (z * y)))) * t));
		} else {
			double VAR_2;
			if ((((double) (((double) (x * y)) - ((double) (z * y)))) <= 4.8151637843688e-320)) {
				VAR_2 = ((double) (y * ((double) (((double) (x - z)) * t))));
			} else {
				double VAR_3;
				if ((((double) (((double) (x * y)) - ((double) (z * y)))) <= 1.0430919384254191e+285)) {
					VAR_3 = ((double) (((double) (((double) (x * y)) - ((double) (z * y)))) * t));
				} else {
					VAR_3 = ((double) (((double) (x - z)) * ((double) (t * y))));
				}
				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

Original6.9
Target3.1
Herbie0.5
\[\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)) < -5.62056246049488059e171 or 1.04309193842541907e285 < (- (* x y) (* z y))

    1. Initial program 31.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--31.3

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

      \[\leadsto \color{blue}{y \cdot \left(\left(x - z\right) \cdot t\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt2.5

      \[\leadsto y \cdot \left(\color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \sqrt[3]{x - z}\right)} \cdot t\right)\]
    7. Applied associate-*l*2.5

      \[\leadsto y \cdot \color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right)}\]
    8. Using strategy rm
    9. Applied pow12.5

      \[\leadsto y \cdot \left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot \color{blue}{{t}^{1}}\right)\right)\]
    10. Applied pow12.5

      \[\leadsto y \cdot \left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\color{blue}{{\left(\sqrt[3]{x - z}\right)}^{1}} \cdot {t}^{1}\right)\right)\]
    11. Applied pow-prod-down2.5

      \[\leadsto y \cdot \left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \color{blue}{{\left(\sqrt[3]{x - z} \cdot t\right)}^{1}}\right)\]
    12. Applied pow12.5

      \[\leadsto y \cdot \left(\left(\sqrt[3]{x - z} \cdot \color{blue}{{\left(\sqrt[3]{x - z}\right)}^{1}}\right) \cdot {\left(\sqrt[3]{x - z} \cdot t\right)}^{1}\right)\]
    13. Applied pow12.5

      \[\leadsto y \cdot \left(\left(\color{blue}{{\left(\sqrt[3]{x - z}\right)}^{1}} \cdot {\left(\sqrt[3]{x - z}\right)}^{1}\right) \cdot {\left(\sqrt[3]{x - z} \cdot t\right)}^{1}\right)\]
    14. Applied pow-prod-down2.5

      \[\leadsto y \cdot \left(\color{blue}{{\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right)}^{1}} \cdot {\left(\sqrt[3]{x - z} \cdot t\right)}^{1}\right)\]
    15. Applied pow-prod-down2.5

      \[\leadsto y \cdot \color{blue}{{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right)}^{1}}\]
    16. Applied pow12.5

      \[\leadsto \color{blue}{{y}^{1}} \cdot {\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right)}^{1}\]
    17. Applied pow-prod-down2.5

      \[\leadsto \color{blue}{{\left(y \cdot \left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right)\right)}^{1}}\]
    18. Simplified1.3

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

    if -5.62056246049488059e171 < (- (* x y) (* z y)) < -4.0135363704689411e-187 or 4.81516e-320 < (- (* x y) (* z y)) < 1.04309193842541907e285

    1. Initial program 0.3

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

    if -4.0135363704689411e-187 < (- (* x y) (* z y)) < 4.81516e-320

    1. Initial program 12.5

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--12.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -5.62056246049488059 \cdot 10^{171}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.0135363704689411 \cdot 10^{-187}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 4.81516 \cdot 10^{-320}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.04309193842541907 \cdot 10^{285}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\ \end{array}\]

Reproduce

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