Average Error: 6.8 → 1.4
Time: 15.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -7.637749908568344465245783068255842775677 \cdot 10^{244}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.591524763393076235512857121471251248446 \cdot 10^{289}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -7.637749908568344465245783068255842775677 \cdot 10^{244}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r27692703 = x;
        double r27692704 = y;
        double r27692705 = r27692703 * r27692704;
        double r27692706 = z;
        double r27692707 = r27692706 * r27692704;
        double r27692708 = r27692705 - r27692707;
        double r27692709 = t;
        double r27692710 = r27692708 * r27692709;
        return r27692710;
}

double f(double x, double y, double z, double t) {
        double r27692711 = x;
        double r27692712 = y;
        double r27692713 = r27692711 * r27692712;
        double r27692714 = z;
        double r27692715 = r27692714 * r27692712;
        double r27692716 = r27692713 - r27692715;
        double r27692717 = -7.637749908568344e+244;
        bool r27692718 = r27692716 <= r27692717;
        double r27692719 = r27692711 - r27692714;
        double r27692720 = t;
        double r27692721 = r27692712 * r27692720;
        double r27692722 = r27692719 * r27692721;
        double r27692723 = 5.591524763393076e+289;
        bool r27692724 = r27692716 <= r27692723;
        double r27692725 = r27692720 * r27692716;
        double r27692726 = r27692720 * r27692719;
        double r27692727 = r27692726 * r27692712;
        double r27692728 = r27692724 ? r27692725 : r27692727;
        double r27692729 = r27692718 ? r27692722 : r27692728;
        return r27692729;
}

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.8
Target3.0
Herbie1.4
\[\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)) < -7.637749908568344e+244

    1. Initial program 35.5

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

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

    if -7.637749908568344e+244 < (- (* x y) (* z y)) < 5.591524763393076e+289

    1. Initial program 1.5

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

    if 5.591524763393076e+289 < (- (* x y) (* z y))

    1. Initial program 53.1

      \[\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.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -7.637749908568344465245783068255842775677 \cdot 10^{244}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.591524763393076235512857121471251248446 \cdot 10^{289}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]

Reproduce

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