Average Error: 7.2 → 2.8
Time: 16.8s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.065299954859988311499887353720063452684 \cdot 10^{-58} \lor \neg \left(t \le 6.967834390730040069510902551400827187322 \cdot 10^{-9}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -2.065299954859988311499887353720063452684 \cdot 10^{-58} \lor \neg \left(t \le 6.967834390730040069510902551400827187322 \cdot 10^{-9}\right):\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r327732 = x;
        double r327733 = y;
        double r327734 = r327732 * r327733;
        double r327735 = z;
        double r327736 = r327735 * r327733;
        double r327737 = r327734 - r327736;
        double r327738 = t;
        double r327739 = r327737 * r327738;
        return r327739;
}

double f(double x, double y, double z, double t) {
        double r327740 = t;
        double r327741 = -2.0652999548599883e-58;
        bool r327742 = r327740 <= r327741;
        double r327743 = 6.96783439073004e-09;
        bool r327744 = r327740 <= r327743;
        double r327745 = !r327744;
        bool r327746 = r327742 || r327745;
        double r327747 = y;
        double r327748 = x;
        double r327749 = z;
        double r327750 = r327748 - r327749;
        double r327751 = r327747 * r327750;
        double r327752 = r327751 * r327740;
        double r327753 = r327750 * r327740;
        double r327754 = r327747 * r327753;
        double r327755 = r327746 ? r327752 : r327754;
        return r327755;
}

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.2
Herbie2.8
\[\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 < -2.0652999548599883e-58 or 6.96783439073004e-09 < t

    1. Initial program 3.6

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

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

    if -2.0652999548599883e-58 < t < 6.96783439073004e-09

    1. Initial program 10.0

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified10.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.065299954859988311499887353720063452684 \cdot 10^{-58} \lor \neg \left(t \le 6.967834390730040069510902551400827187322 \cdot 10^{-9}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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