Average Error: 7.2 → 2.8
Time: 3.5s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.79246645941082474 \cdot 10^{66} \lor \neg \left(y \le 5593.7482683519529\right):\\ \;\;\;\;\left(y \cdot t\right) \cdot {\left(x - z\right)}^{1}\\ \mathbf{else}:\\ \;\;\;\;t \cdot {\left(y \cdot \left(x - z\right)\right)}^{1}\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -2.79246645941082474 \cdot 10^{66} \lor \neg \left(y \le 5593.7482683519529\right):\\
\;\;\;\;\left(y \cdot t\right) \cdot {\left(x - z\right)}^{1}\\

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

\end{array}
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 temp;
	if (((y <= -2.7924664594108247e+66) || !(y <= 5593.748268351953))) {
		temp = ((y * t) * pow((x - z), 1.0));
	} else {
		temp = (t * pow((y * (x - z)), 1.0));
	}
	return temp;
}

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.2
Target3.0
Herbie2.8
\[\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 y < -2.7924664594108247e+66 or 5593.748268351953 < y

    1. Initial program 17.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified17.4

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

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

      \[\leadsto t \cdot \left(\color{blue}{{y}^{1}} \cdot {\left(x - z\right)}^{1}\right)\]
    6. Applied pow-prod-down17.4

      \[\leadsto t \cdot \color{blue}{{\left(y \cdot \left(x - z\right)\right)}^{1}}\]
    7. Using strategy rm
    8. Applied unpow-prod-down17.4

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

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

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

    if -2.7924664594108247e+66 < y < 5593.748268351953

    1. Initial program 2.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.79246645941082474 \cdot 10^{66} \lor \neg \left(y \le 5593.7482683519529\right):\\ \;\;\;\;\left(y \cdot t\right) \cdot {\left(x - z\right)}^{1}\\ \mathbf{else}:\\ \;\;\;\;t \cdot {\left(y \cdot \left(x - z\right)\right)}^{1}\\ \end{array}\]

Reproduce

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