Average Error: 6.9 → 0.3
Time: 2.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 -1.2464801089300593 \cdot 10^{269}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -2.13568086354090478 \cdot 10^{-295}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.9498152 \cdot 10^{-318}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.41316001391597297 \cdot 10^{273}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \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 \le -1.2464801089300593 \cdot 10^{269}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r539100 = x;
        double r539101 = y;
        double r539102 = r539100 * r539101;
        double r539103 = z;
        double r539104 = r539103 * r539101;
        double r539105 = r539102 - r539104;
        double r539106 = t;
        double r539107 = r539105 * r539106;
        return r539107;
}

double f(double x, double y, double z, double t) {
        double r539108 = x;
        double r539109 = y;
        double r539110 = r539108 * r539109;
        double r539111 = z;
        double r539112 = r539111 * r539109;
        double r539113 = r539110 - r539112;
        double r539114 = -1.2464801089300593e+269;
        bool r539115 = r539113 <= r539114;
        double r539116 = t;
        double r539117 = r539116 * r539109;
        double r539118 = r539108 - r539111;
        double r539119 = r539117 * r539118;
        double r539120 = -2.1356808635409048e-295;
        bool r539121 = r539113 <= r539120;
        double r539122 = r539116 * r539113;
        double r539123 = 1.9498152493431e-318;
        bool r539124 = r539113 <= r539123;
        double r539125 = 5.413160013915973e+273;
        bool r539126 = r539113 <= r539125;
        double r539127 = r539118 * r539116;
        double r539128 = r539109 * r539127;
        double r539129 = r539126 ? r539122 : r539128;
        double r539130 = r539124 ? r539119 : r539129;
        double r539131 = r539121 ? r539122 : r539130;
        double r539132 = r539115 ? r539119 : r539131;
        return r539132;
}

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
Herbie0.3
\[\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 3 regimes
  2. if (- (* x y) (* z y)) < -1.2464801089300593e+269 or -2.1356808635409048e-295 < (- (* x y) (* z y)) < 1.9498152493431e-318

    1. Initial program 31.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-commutative31.3

      \[\leadsto \color{blue}{t \cdot \left(x \cdot y - z \cdot y\right)}\]
    4. Using strategy rm
    5. Applied distribute-rgt-out--31.3

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

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

    if -1.2464801089300593e+269 < (- (* x y) (* z y)) < -2.1356808635409048e-295 or 1.9498152493431e-318 < (- (* x y) (* z y)) < 5.413160013915973e+273

    1. Initial program 0.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-commutative0.3

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

    if 5.413160013915973e+273 < (- (* x y) (* z y))

    1. Initial program 48.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -1.2464801089300593 \cdot 10^{269}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -2.13568086354090478 \cdot 10^{-295}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.9498152 \cdot 10^{-318}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.41316001391597297 \cdot 10^{273}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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