Average Error: 7.4 → 0.5
Time: 12.4s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -9.28546639189079822726342632154485811791 \cdot 10^{-250}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.207146899072114501620361812179724065154 \cdot 10^{-243}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.010117805898266714360417458543683393234 \cdot 10^{141}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\
\;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\

\mathbf{elif}\;x \cdot y - z \cdot y \le -9.28546639189079822726342632154485811791 \cdot 10^{-250}:\\
\;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\

\mathbf{elif}\;x \cdot y - z \cdot y \le 1.207146899072114501620361812179724065154 \cdot 10^{-243}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;x \cdot y - z \cdot y \le 9.010117805898266714360417458543683393234 \cdot 10^{141}:\\
\;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r28448236 = x;
        double r28448237 = y;
        double r28448238 = r28448236 * r28448237;
        double r28448239 = z;
        double r28448240 = r28448239 * r28448237;
        double r28448241 = r28448238 - r28448240;
        double r28448242 = t;
        double r28448243 = r28448241 * r28448242;
        return r28448243;
}

double f(double x, double y, double z, double t) {
        double r28448244 = x;
        double r28448245 = y;
        double r28448246 = r28448244 * r28448245;
        double r28448247 = z;
        double r28448248 = r28448247 * r28448245;
        double r28448249 = r28448246 - r28448248;
        double r28448250 = -inf.0;
        bool r28448251 = r28448249 <= r28448250;
        double r28448252 = t;
        double r28448253 = r28448244 - r28448247;
        double r28448254 = r28448252 * r28448253;
        double r28448255 = r28448254 * r28448245;
        double r28448256 = -9.285466391890798e-250;
        bool r28448257 = r28448249 <= r28448256;
        double r28448258 = r28448252 * r28448249;
        double r28448259 = 1.2071468990721145e-243;
        bool r28448260 = r28448249 <= r28448259;
        double r28448261 = r28448245 * r28448252;
        double r28448262 = r28448253 * r28448261;
        double r28448263 = 9.010117805898267e+141;
        bool r28448264 = r28448249 <= r28448263;
        double r28448265 = r28448264 ? r28448258 : r28448262;
        double r28448266 = r28448260 ? r28448262 : r28448265;
        double r28448267 = r28448257 ? r28448258 : r28448266;
        double r28448268 = r28448251 ? r28448255 : r28448267;
        return r28448268;
}

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.4
Target3.1
Herbie0.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 3 regimes
  2. if (- (* x y) (* z y)) < -inf.0

    1. Initial program 64.0

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

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

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

    if -inf.0 < (- (* x y) (* z y)) < -9.285466391890798e-250 or 1.2071468990721145e-243 < (- (* x y) (* z y)) < 9.010117805898267e+141

    1. Initial program 0.2

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

    if -9.285466391890798e-250 < (- (* x y) (* z y)) < 1.2071468990721145e-243 or 9.010117805898267e+141 < (- (* x y) (* z y))

    1. Initial program 18.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -9.28546639189079822726342632154485811791 \cdot 10^{-250}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.207146899072114501620361812179724065154 \cdot 10^{-243}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.010117805898266714360417458543683393234 \cdot 10^{141}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019179 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"

  :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))