Average Error: 6.7 → 3.4
Time: 17.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -876245470925403675688960:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 1.423758204789824948069288977989847450071 \cdot 10^{161}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -876245470925403675688960:\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r270321658 = x;
        double r270321659 = y;
        double r270321660 = r270321658 * r270321659;
        double r270321661 = z;
        double r270321662 = r270321661 * r270321659;
        double r270321663 = r270321660 - r270321662;
        double r270321664 = t;
        double r270321665 = r270321663 * r270321664;
        return r270321665;
}

double f(double x, double y, double z, double t) {
        double r270321666 = t;
        double r270321667 = -8.762454709254037e+23;
        bool r270321668 = r270321666 <= r270321667;
        double r270321669 = y;
        double r270321670 = x;
        double r270321671 = z;
        double r270321672 = r270321670 - r270321671;
        double r270321673 = r270321669 * r270321672;
        double r270321674 = r270321673 * r270321666;
        double r270321675 = 1.423758204789825e+161;
        bool r270321676 = r270321666 <= r270321675;
        double r270321677 = r270321672 * r270321666;
        double r270321678 = r270321669 * r270321677;
        double r270321679 = r270321676 ? r270321678 : r270321674;
        double r270321680 = r270321668 ? r270321674 : r270321679;
        return r270321680;
}

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
Herbie3.4
\[\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 t < -8.762454709254037e+23 or 1.423758204789825e+161 < t

    1. Initial program 3.9

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified3.9

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

    if -8.762454709254037e+23 < t < 1.423758204789825e+161

    1. Initial program 7.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -876245470925403675688960:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 1.423758204789824948069288977989847450071 \cdot 10^{161}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]

Reproduce

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

  :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))