Average Error: 6.9 → 0.3
Time: 3.8s
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 -4.58287967372564715 \cdot 10^{-194} \lor \neg \left(x \cdot y - z \cdot y \le 3.33973174977735668 \cdot 10^{-232} \lor \neg \left(x \cdot y - z \cdot y \le 5.41316001391597297 \cdot 10^{273}\right)\right)\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\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 \lor \neg \left(x \cdot y - z \cdot y \le -4.58287967372564715 \cdot 10^{-194} \lor \neg \left(x \cdot y - z \cdot y \le 3.33973174977735668 \cdot 10^{-232} \lor \neg \left(x \cdot y - z \cdot y \le 5.41316001391597297 \cdot 10^{273}\right)\right)\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r595305 = x;
        double r595306 = y;
        double r595307 = r595305 * r595306;
        double r595308 = z;
        double r595309 = r595308 * r595306;
        double r595310 = r595307 - r595309;
        double r595311 = t;
        double r595312 = r595310 * r595311;
        return r595312;
}

double f(double x, double y, double z, double t) {
        double r595313 = x;
        double r595314 = y;
        double r595315 = r595313 * r595314;
        double r595316 = z;
        double r595317 = r595316 * r595314;
        double r595318 = r595315 - r595317;
        double r595319 = -inf.0;
        bool r595320 = r595318 <= r595319;
        double r595321 = -4.582879673725647e-194;
        bool r595322 = r595318 <= r595321;
        double r595323 = 3.339731749777357e-232;
        bool r595324 = r595318 <= r595323;
        double r595325 = 5.413160013915973e+273;
        bool r595326 = r595318 <= r595325;
        double r595327 = !r595326;
        bool r595328 = r595324 || r595327;
        double r595329 = !r595328;
        bool r595330 = r595322 || r595329;
        double r595331 = !r595330;
        bool r595332 = r595320 || r595331;
        double r595333 = r595313 - r595316;
        double r595334 = t;
        double r595335 = r595333 * r595334;
        double r595336 = r595314 * r595335;
        double r595337 = r595334 * r595318;
        double r595338 = r595332 ? r595336 : r595337;
        return r595338;
}

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 2 regimes
  2. if (- (* x y) (* z y)) < -inf.0 or -4.582879673725647e-194 < (- (* x y) (* z y)) < 3.339731749777357e-232 or 5.413160013915973e+273 < (- (* x y) (* z y))

    1. Initial program 29.2

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

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

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

    if -inf.0 < (- (* x y) (* z y)) < -4.582879673725647e-194 or 3.339731749777357e-232 < (- (* 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 *-un-lft-identity0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -4.58287967372564715 \cdot 10^{-194} \lor \neg \left(x \cdot y - z \cdot y \le 3.33973174977735668 \cdot 10^{-232} \lor \neg \left(x \cdot y - z \cdot y \le 5.41316001391597297 \cdot 10^{273}\right)\right)\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\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))