Average Error: 7.3 → 2.7
Time: 11.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -3.324543296029851102701968557084910571575 \lor \neg \left(y \le 3.537250054386100012523485015523447758753 \cdot 10^{-83}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - z\right) \cdot y\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -3.324543296029851102701968557084910571575 \lor \neg \left(y \le 3.537250054386100012523485015523447758753 \cdot 10^{-83}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r385429 = x;
        double r385430 = y;
        double r385431 = r385429 * r385430;
        double r385432 = z;
        double r385433 = r385432 * r385430;
        double r385434 = r385431 - r385433;
        double r385435 = t;
        double r385436 = r385434 * r385435;
        return r385436;
}

double f(double x, double y, double z, double t) {
        double r385437 = y;
        double r385438 = -3.324543296029851;
        bool r385439 = r385437 <= r385438;
        double r385440 = 3.5372500543861e-83;
        bool r385441 = r385437 <= r385440;
        double r385442 = !r385441;
        bool r385443 = r385439 || r385442;
        double r385444 = x;
        double r385445 = z;
        double r385446 = r385444 - r385445;
        double r385447 = t;
        double r385448 = r385446 * r385447;
        double r385449 = r385437 * r385448;
        double r385450 = r385446 * r385437;
        double r385451 = r385450 * r385447;
        double r385452 = r385443 ? r385449 : r385451;
        return r385452;
}

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.3
Target3.2
Herbie2.7
\[\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 < -3.324543296029851 or 3.5372500543861e-83 < y

    1. Initial program 13.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified13.4

      \[\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)}\]

    if -3.324543296029851 < y < 3.5372500543861e-83

    1. Initial program 2.2

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

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right) \cdot t}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity2.2

      \[\leadsto \left(y \cdot \left(x - z\right)\right) \cdot \color{blue}{\left(1 \cdot t\right)}\]
    5. Applied associate-*r*2.2

      \[\leadsto \color{blue}{\left(\left(y \cdot \left(x - z\right)\right) \cdot 1\right) \cdot t}\]
    6. Simplified2.2

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

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

Reproduce

herbie shell --seed 2019235 +o rules:numerics
(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))