Average Error: 7.0 → 3.0
Time: 9.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -7.89855730043848662453832577712094659601 \cdot 10^{102} \lor \neg \left(t \le 1.942514649585053196773819820514152676405 \cdot 10^{-44}\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 -7.89855730043848662453832577712094659601 \cdot 10^{102} \lor \neg \left(t \le 1.942514649585053196773819820514152676405 \cdot 10^{-44}\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 r366071 = x;
        double r366072 = y;
        double r366073 = r366071 * r366072;
        double r366074 = z;
        double r366075 = r366074 * r366072;
        double r366076 = r366073 - r366075;
        double r366077 = t;
        double r366078 = r366076 * r366077;
        return r366078;
}

double f(double x, double y, double z, double t) {
        double r366079 = t;
        double r366080 = -7.898557300438487e+102;
        bool r366081 = r366079 <= r366080;
        double r366082 = 1.9425146495850532e-44;
        bool r366083 = r366079 <= r366082;
        double r366084 = !r366083;
        bool r366085 = r366081 || r366084;
        double r366086 = y;
        double r366087 = x;
        double r366088 = z;
        double r366089 = r366087 - r366088;
        double r366090 = r366086 * r366089;
        double r366091 = r366090 * r366079;
        double r366092 = r366089 * r366079;
        double r366093 = r366086 * r366092;
        double r366094 = r366085 ? r366091 : r366093;
        return r366094;
}

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.1
Herbie3.0
\[\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 < -7.898557300438487e+102 or 1.9425146495850532e-44 < 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 -7.898557300438487e+102 < t < 1.9425146495850532e-44

    1. Initial program 8.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified8.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -7.89855730043848662453832577712094659601 \cdot 10^{102} \lor \neg \left(t \le 1.942514649585053196773819820514152676405 \cdot 10^{-44}\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 2019209 
(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))