Average Error: 7.5 → 1.5
Time: 13.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -4.475560541981180625389373862309574765434 \cdot 10^{277} \lor \neg \left(x \cdot y - z \cdot y \le 1.775191623851220465574628585536100594199 \cdot 10^{264}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\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 -4.475560541981180625389373862309574765434 \cdot 10^{277} \lor \neg \left(x \cdot y - z \cdot y \le 1.775191623851220465574628585536100594199 \cdot 10^{264}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\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 r350537 = x;
        double r350538 = y;
        double r350539 = r350537 * r350538;
        double r350540 = z;
        double r350541 = r350540 * r350538;
        double r350542 = r350539 - r350541;
        double r350543 = t;
        double r350544 = r350542 * r350543;
        return r350544;
}

double f(double x, double y, double z, double t) {
        double r350545 = x;
        double r350546 = y;
        double r350547 = r350545 * r350546;
        double r350548 = z;
        double r350549 = r350548 * r350546;
        double r350550 = r350547 - r350549;
        double r350551 = -4.475560541981181e+277;
        bool r350552 = r350550 <= r350551;
        double r350553 = 1.7751916238512205e+264;
        bool r350554 = r350550 <= r350553;
        double r350555 = !r350554;
        bool r350556 = r350552 || r350555;
        double r350557 = r350545 - r350548;
        double r350558 = t;
        double r350559 = r350557 * r350558;
        double r350560 = r350546 * r350559;
        double r350561 = r350550 * r350558;
        double r350562 = r350556 ? r350560 : r350561;
        return r350562;
}

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.5
Target3.2
Herbie1.5
\[\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)) < -4.475560541981181e+277 or 1.7751916238512205e+264 < (- (* x y) (* z y))

    1. Initial program 47.2

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

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

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

    if -4.475560541981181e+277 < (- (* x y) (* z y)) < 1.7751916238512205e+264

    1. Initial program 1.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

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

Reproduce

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