Average Error: 7.0 → 1.4
Time: 14.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 -2.463499167606939085331656027995681059505 \cdot 10^{200} \lor \neg \left(x \cdot y - z \cdot y \le 6.777688716742269720248573286984588117237 \cdot 10^{235}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\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 -2.463499167606939085331656027995681059505 \cdot 10^{200} \lor \neg \left(x \cdot y - z \cdot y \le 6.777688716742269720248573286984588117237 \cdot 10^{235}\right):\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\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 r356951 = x;
        double r356952 = y;
        double r356953 = r356951 * r356952;
        double r356954 = z;
        double r356955 = r356954 * r356952;
        double r356956 = r356953 - r356955;
        double r356957 = t;
        double r356958 = r356956 * r356957;
        return r356958;
}

double f(double x, double y, double z, double t) {
        double r356959 = x;
        double r356960 = y;
        double r356961 = r356959 * r356960;
        double r356962 = z;
        double r356963 = r356962 * r356960;
        double r356964 = r356961 - r356963;
        double r356965 = -2.463499167606939e+200;
        bool r356966 = r356964 <= r356965;
        double r356967 = 6.77768871674227e+235;
        bool r356968 = r356964 <= r356967;
        double r356969 = !r356968;
        bool r356970 = r356966 || r356969;
        double r356971 = t;
        double r356972 = r356959 - r356962;
        double r356973 = r356971 * r356972;
        double r356974 = r356960 * r356973;
        double r356975 = r356964 * r356971;
        double r356976 = r356970 ? r356974 : r356975;
        return r356976;
}

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.2
Herbie1.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 (- (* x y) (* z y)) < -2.463499167606939e+200 or 6.77768871674227e+235 < (- (* x y) (* z y))

    1. Initial program 32.1

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

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

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

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

    if -2.463499167606939e+200 < (- (* x y) (* z y)) < 6.77768871674227e+235

    1. Initial program 1.5

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied pow11.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -2.463499167606939085331656027995681059505 \cdot 10^{200} \lor \neg \left(x \cdot y - z \cdot y \le 6.777688716742269720248573286984588117237 \cdot 10^{235}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

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