Average Error: 6.6 → 0.8
Time: 10.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -4.459424609020142156947398974899037795759 \cdot 10^{249} \lor \neg \left(x \cdot y - z \cdot y \le -1.008422558588387463522628361222361000871 \cdot 10^{-262} \lor \neg \left(x \cdot y - z \cdot y \le 4.940656458412465441765687928682213723651 \cdot 10^{-324}\right) \land x \cdot y - z \cdot y \le 5.349644244500557066718563752047260703027 \cdot 10^{131}\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 \le -4.459424609020142156947398974899037795759 \cdot 10^{249} \lor \neg \left(x \cdot y - z \cdot y \le -1.008422558588387463522628361222361000871 \cdot 10^{-262} \lor \neg \left(x \cdot y - z \cdot y \le 4.940656458412465441765687928682213723651 \cdot 10^{-324}\right) \land x \cdot y - z \cdot y \le 5.349644244500557066718563752047260703027 \cdot 10^{131}\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 r472384 = x;
        double r472385 = y;
        double r472386 = r472384 * r472385;
        double r472387 = z;
        double r472388 = r472387 * r472385;
        double r472389 = r472386 - r472388;
        double r472390 = t;
        double r472391 = r472389 * r472390;
        return r472391;
}

double f(double x, double y, double z, double t) {
        double r472392 = x;
        double r472393 = y;
        double r472394 = r472392 * r472393;
        double r472395 = z;
        double r472396 = r472395 * r472393;
        double r472397 = r472394 - r472396;
        double r472398 = -4.459424609020142e+249;
        bool r472399 = r472397 <= r472398;
        double r472400 = -1.0084225585883875e-262;
        bool r472401 = r472397 <= r472400;
        double r472402 = 4.9406564584125e-324;
        bool r472403 = r472397 <= r472402;
        double r472404 = !r472403;
        double r472405 = 5.349644244500557e+131;
        bool r472406 = r472397 <= r472405;
        bool r472407 = r472404 && r472406;
        bool r472408 = r472401 || r472407;
        double r472409 = !r472408;
        bool r472410 = r472399 || r472409;
        double r472411 = r472392 - r472395;
        double r472412 = t;
        double r472413 = r472411 * r472412;
        double r472414 = r472393 * r472413;
        double r472415 = r472397 * r472412;
        double r472416 = r472410 ? r472414 : r472415;
        return r472416;
}

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.6
Target2.9
Herbie0.8
\[\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 2 regimes
  2. if (- (* x y) (* z y)) < -4.459424609020142e+249 or -1.0084225585883875e-262 < (- (* x y) (* z y)) < 4.9406564584125e-324 or 5.349644244500557e+131 < (- (* x y) (* z y))

    1. Initial program 22.7

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

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

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

    if -4.459424609020142e+249 < (- (* x y) (* z y)) < -1.0084225585883875e-262 or 4.9406564584125e-324 < (- (* x y) (* z y)) < 5.349644244500557e+131

    1. Initial program 0.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -4.459424609020142156947398974899037795759 \cdot 10^{249} \lor \neg \left(x \cdot y - z \cdot y \le -1.008422558588387463522628361222361000871 \cdot 10^{-262} \lor \neg \left(x \cdot y - z \cdot y \le 4.940656458412465441765687928682213723651 \cdot 10^{-324}\right) \land x \cdot y - z \cdot y \le 5.349644244500557066718563752047260703027 \cdot 10^{131}\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 2019212 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

  (* (- (* x y) (* z y)) t))