Average Error: 6.9 → 2.9
Time: 4.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.609581956780726333267024020369508065846 \cdot 10^{86} \lor \neg \left(y \le 79083532632380520335137431897030862569470\right):\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -1.609581956780726333267024020369508065846 \cdot 10^{86} \lor \neg \left(y \le 79083532632380520335137431897030862569470\right):\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r495594 = x;
        double r495595 = y;
        double r495596 = r495594 * r495595;
        double r495597 = z;
        double r495598 = r495597 * r495595;
        double r495599 = r495596 - r495598;
        double r495600 = t;
        double r495601 = r495599 * r495600;
        return r495601;
}

double f(double x, double y, double z, double t) {
        double r495602 = y;
        double r495603 = -1.6095819567807263e+86;
        bool r495604 = r495602 <= r495603;
        double r495605 = 7.908353263238052e+40;
        bool r495606 = r495602 <= r495605;
        double r495607 = !r495606;
        bool r495608 = r495604 || r495607;
        double r495609 = t;
        double r495610 = r495609 * r495602;
        double r495611 = x;
        double r495612 = z;
        double r495613 = r495611 - r495612;
        double r495614 = r495610 * r495613;
        double r495615 = r495602 * r495613;
        double r495616 = r495609 * r495615;
        double r495617 = r495608 ? r495614 : r495616;
        return r495617;
}

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.9
Target3.0
Herbie2.9
\[\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 y < -1.6095819567807263e+86 or 7.908353263238052e+40 < y

    1. Initial program 18.1

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified18.1

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

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

    if -1.6095819567807263e+86 < y < 7.908353263238052e+40

    1. Initial program 2.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.3

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

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

Reproduce

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