Average Error: 6.7 → 0.5
Time: 9.1s
Precision: binary64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - y \cdot z \leq -7.061304053484176 \cdot 10^{+159}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \leq -7.819455715384067 \cdot 10^{-206}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \leq 2.8211894865769658 \cdot 10^{-242}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \leq 1.600834896909424 \cdot 10^{+294}:\\ \;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - y \cdot z \leq -7.061304053484176 \cdot 10^{+159}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

\mathbf{elif}\;x \cdot y - y \cdot z \leq -7.819455715384067 \cdot 10^{-206}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\

\mathbf{elif}\;x \cdot y - y \cdot z \leq 2.8211894865769658 \cdot 10^{-242}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\

\mathbf{elif}\;x \cdot y - y \cdot z \leq 1.600834896909424 \cdot 10^{+294}:\\
\;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\

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

\end{array}
(FPCore (x y z t) :precision binary64 (* (- (* x y) (* z y)) t))
(FPCore (x y z t)
 :precision binary64
 (if (<= (- (* x y) (* y z)) -7.061304053484176e+159)
   (* (* y t) (- x z))
   (if (<= (- (* x y) (* y z)) -7.819455715384067e-206)
     (* t (* y (- x z)))
     (if (<= (- (* x y) (* y z)) 2.8211894865769658e-242)
       (* y (* t (- x z)))
       (if (<= (- (* x y) (* y z)) 1.600834896909424e+294)
         (* (- (* x y) (* y z)) t)
         (* (* y t) (- x z)))))))
double code(double x, double y, double z, double t) {
	return ((x * y) - (z * y)) * t;
}
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x * y) - (y * z)) <= -7.061304053484176e+159) {
		tmp = (y * t) * (x - z);
	} else if (((x * y) - (y * z)) <= -7.819455715384067e-206) {
		tmp = t * (y * (x - z));
	} else if (((x * y) - (y * z)) <= 2.8211894865769658e-242) {
		tmp = y * (t * (x - z));
	} else if (((x * y) - (y * z)) <= 1.600834896909424e+294) {
		tmp = ((x * y) - (y * z)) * t;
	} else {
		tmp = (y * t) * (x - z);
	}
	return tmp;
}

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.7
Target3.2
Herbie0.5
\[\begin{array}{l} \mathbf{if}\;t < -9.231879582886777 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t < 2.543067051564877 \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 4 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z y)) < -7.0613040534841755e159 or 1.6008348969094239e294 < (-.f64 (*.f64 x y) (*.f64 z y))

    1. Initial program 31.9

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

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

    if -7.0613040534841755e159 < (-.f64 (*.f64 x y) (*.f64 z y)) < -7.8194557153840671e-206

    1. Initial program 0.3

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

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

    if -7.8194557153840671e-206 < (-.f64 (*.f64 x y) (*.f64 z y)) < 2.8211894865769658e-242

    1. Initial program 8.7

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

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

    if 2.8211894865769658e-242 < (-.f64 (*.f64 x y) (*.f64 z y)) < 1.6008348969094239e294

    1. Initial program 0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - y \cdot z \leq -7.061304053484176 \cdot 10^{+159}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \leq -7.819455715384067 \cdot 10^{-206}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \leq 2.8211894865769658 \cdot 10^{-242}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{elif}\;x \cdot y - y \cdot z \leq 1.600834896909424 \cdot 10^{+294}:\\ \;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

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