Average Error: 6.9 → 0.4
Time: 12.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 -8.195669489681609678798574875257253827771 \cdot 10^{239}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.838984261423296633673495406852766881499 \cdot 10^{-245}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.584401045790907446074774340867010475211 \cdot 10^{-151}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.47804001699789240780003797872227611413 \cdot 10^{211}:\\ \;\;\;\;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 -8.195669489681609678798574875257253827771 \cdot 10^{239}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

\mathbf{elif}\;x \cdot y - z \cdot y \le 8.47804001699789240780003797872227611413 \cdot 10^{211}:\\
\;\;\;\;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 r502321 = x;
        double r502322 = y;
        double r502323 = r502321 * r502322;
        double r502324 = z;
        double r502325 = r502324 * r502322;
        double r502326 = r502323 - r502325;
        double r502327 = t;
        double r502328 = r502326 * r502327;
        return r502328;
}

double f(double x, double y, double z, double t) {
        double r502329 = x;
        double r502330 = y;
        double r502331 = r502329 * r502330;
        double r502332 = z;
        double r502333 = r502332 * r502330;
        double r502334 = r502331 - r502333;
        double r502335 = -8.19566948968161e+239;
        bool r502336 = r502334 <= r502335;
        double r502337 = t;
        double r502338 = r502337 * r502330;
        double r502339 = r502329 - r502332;
        double r502340 = r502338 * r502339;
        double r502341 = -3.838984261423297e-245;
        bool r502342 = r502334 <= r502341;
        double r502343 = r502337 * r502334;
        double r502344 = 1.5844010457909074e-151;
        bool r502345 = r502334 <= r502344;
        double r502346 = 8.478040016997892e+211;
        bool r502347 = r502334 <= r502346;
        double r502348 = r502337 * r502339;
        double r502349 = r502348 * r502330;
        double r502350 = r502347 ? r502343 : r502349;
        double r502351 = r502345 ? r502340 : r502350;
        double r502352 = r502342 ? r502343 : r502351;
        double r502353 = r502336 ? r502340 : r502352;
        return r502353;
}

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.2
Herbie0.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)) < -8.19566948968161e+239 or -3.838984261423297e-245 < (- (* x y) (* z y)) < 1.5844010457909074e-151

    1. Initial program 17.9

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Taylor expanded around inf 17.9

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

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

    if -8.19566948968161e+239 < (- (* x y) (* z y)) < -3.838984261423297e-245 or 1.5844010457909074e-151 < (- (* x y) (* z y)) < 8.478040016997892e+211

    1. Initial program 0.2

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

    if 8.478040016997892e+211 < (- (* x y) (* z y))

    1. Initial program 29.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -8.195669489681609678798574875257253827771 \cdot 10^{239}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -3.838984261423296633673495406852766881499 \cdot 10^{-245}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.584401045790907446074774340867010475211 \cdot 10^{-151}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.47804001699789240780003797872227611413 \cdot 10^{211}:\\ \;\;\;\;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 2019194 
(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))