Average Error: 6.9 → 1.8
Time: 4.0s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le 5.194293911522653 \cdot 10^{144}\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 = -\infty \lor \neg \left(x \cdot y - z \cdot y \le 5.194293911522653 \cdot 10^{144}\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 r598111 = x;
        double r598112 = y;
        double r598113 = r598111 * r598112;
        double r598114 = z;
        double r598115 = r598114 * r598112;
        double r598116 = r598113 - r598115;
        double r598117 = t;
        double r598118 = r598116 * r598117;
        return r598118;
}

double f(double x, double y, double z, double t) {
        double r598119 = x;
        double r598120 = y;
        double r598121 = r598119 * r598120;
        double r598122 = z;
        double r598123 = r598122 * r598120;
        double r598124 = r598121 - r598123;
        double r598125 = -inf.0;
        bool r598126 = r598124 <= r598125;
        double r598127 = 5.1942939115226525e+144;
        bool r598128 = r598124 <= r598127;
        double r598129 = !r598128;
        bool r598130 = r598126 || r598129;
        double r598131 = r598119 - r598122;
        double r598132 = t;
        double r598133 = r598131 * r598132;
        double r598134 = r598120 * r598133;
        double r598135 = r598124 * r598132;
        double r598136 = r598130 ? r598134 : r598135;
        return r598136;
}

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.1
Herbie1.8
\[\begin{array}{l} \mathbf{if}\;t \lt -9.2318795828867769 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.5430670515648771 \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)) < -inf.0 or 5.1942939115226525e+144 < (- (* x y) (* z y))

    1. Initial program 30.9

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

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

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

    if -inf.0 < (- (* x y) (* z y)) < 5.1942939115226525e+144

    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.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le 5.194293911522653 \cdot 10^{144}\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 2020065 
(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))