Average Error: 7.0 → 2.7
Time: 3.3s
Precision: binary64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \leq -10.53972593920637:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;y \leq 5.665083954679196 \cdot 10^{-72}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot x\right) - y \cdot \left(t \cdot z\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \leq -10.53972593920637:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

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

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

\end{array}
(FPCore (x y z t) :precision binary64 (* (- (* x y) (* z y)) t))
(FPCore (x y z t)
 :precision binary64
 (if (<= y -10.53972593920637)
   (* (* y t) (- x z))
   (if (<= y 5.665083954679196e-72)
     (* t (* y (- x z)))
     (- (* y (* t x)) (* y (* t z))))))
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 tmp;
	if ((y <= -10.53972593920637)) {
		tmp = ((double) (((double) (y * t)) * ((double) (x - z))));
	} else {
		double tmp_1;
		if ((y <= 5.665083954679196e-72)) {
			tmp_1 = ((double) (t * ((double) (y * ((double) (x - z))))));
		} else {
			tmp_1 = ((double) (((double) (y * ((double) (t * x)))) - ((double) (y * ((double) (t * z))))));
		}
		tmp = tmp_1;
	}
	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

Original7.0
Target3.0
Herbie2.7
\[\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 3 regimes
  2. if y < -10.53972593920637

    1. Initial program Error: 15.4 bits

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. SimplifiedError: 3.0 bits

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

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

    if -10.53972593920637 < y < 5.6650839546791963e-72

    1. Initial program Error: 2.2 bits

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

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

      \[\leadsto \color{blue}{\left(\left(x \cdot y - z \cdot y\right) \cdot 1\right) \cdot t}\]
    5. SimplifiedError: 2.2 bits

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

    if 5.6650839546791963e-72 < y

    1. Initial program Error: 11.0 bits

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. SimplifiedError: 3.2 bits

      \[\leadsto \color{blue}{y \cdot \left(t \cdot \left(x - z\right)\right)}\]
    3. Using strategy rm
    4. Applied sub-negError: 3.2 bits

      \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(x + \left(-z\right)\right)}\right)\]
    5. Applied distribute-lft-inError: 3.2 bits

      \[\leadsto y \cdot \color{blue}{\left(t \cdot x + t \cdot \left(-z\right)\right)}\]
    6. Applied distribute-lft-inError: 3.1 bits

      \[\leadsto \color{blue}{y \cdot \left(t \cdot x\right) + y \cdot \left(t \cdot \left(-z\right)\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplificationError: 2.7 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -10.53972593920637:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;y \leq 5.665083954679196 \cdot 10^{-72}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot x\right) - y \cdot \left(t \cdot z\right)\\ \end{array}\]

Reproduce

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