Average Error: 7.3 → 1.3
Time: 13.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -1.408609285106859205265187205065954549148 \cdot 10^{267} \lor \neg \left(x \cdot y - z \cdot y \le 5.703077828099037508205732225249978792094 \cdot 10^{266}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -1.408609285106859205265187205065954549148 \cdot 10^{267} \lor \neg \left(x \cdot y - z \cdot y \le 5.703077828099037508205732225249978792094 \cdot 10^{266}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r473103 = x;
        double r473104 = y;
        double r473105 = r473103 * r473104;
        double r473106 = z;
        double r473107 = r473106 * r473104;
        double r473108 = r473105 - r473107;
        double r473109 = t;
        double r473110 = r473108 * r473109;
        return r473110;
}

double f(double x, double y, double z, double t) {
        double r473111 = x;
        double r473112 = y;
        double r473113 = r473111 * r473112;
        double r473114 = z;
        double r473115 = r473114 * r473112;
        double r473116 = r473113 - r473115;
        double r473117 = -1.4086092851068592e+267;
        bool r473118 = r473116 <= r473117;
        double r473119 = 5.703077828099038e+266;
        bool r473120 = r473116 <= r473119;
        double r473121 = !r473120;
        bool r473122 = r473118 || r473121;
        double r473123 = r473111 - r473114;
        double r473124 = t;
        double r473125 = r473123 * r473124;
        double r473126 = r473112 * r473125;
        double r473127 = r473116 * r473124;
        double r473128 = r473122 ? r473126 : r473127;
        return r473128;
}

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.3
Target3.2
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886776938073886590448747944753 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877116200336808272775217995 \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)) < -1.4086092851068592e+267 or 5.703077828099038e+266 < (- (* x y) (* z y))

    1. Initial program 46.9

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

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

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

    if -1.4086092851068592e+267 < (- (* x y) (* z y)) < 5.703077828099038e+266

    1. Initial program 1.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -1.408609285106859205265187205065954549148 \cdot 10^{267} \lor \neg \left(x \cdot y - z \cdot y \le 5.703077828099037508205732225249978792094 \cdot 10^{266}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2019235 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

  (* (- (* x y) (* z y)) t))