Average Error: 6.9 → 3.3
Time: 16.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -4.856164112248959329219151378456217111614 \cdot 10^{-91} \lor \neg \left(y \le 3.025418364347031062019168566536185959801 \cdot 10^{108}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -4.856164112248959329219151378456217111614 \cdot 10^{-91} \lor \neg \left(y \le 3.025418364347031062019168566536185959801 \cdot 10^{108}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r1016317 = x;
        double r1016318 = y;
        double r1016319 = r1016317 * r1016318;
        double r1016320 = z;
        double r1016321 = r1016320 * r1016318;
        double r1016322 = r1016319 - r1016321;
        double r1016323 = t;
        double r1016324 = r1016322 * r1016323;
        return r1016324;
}

double f(double x, double y, double z, double t) {
        double r1016325 = y;
        double r1016326 = -4.8561641122489593e-91;
        bool r1016327 = r1016325 <= r1016326;
        double r1016328 = 3.025418364347031e+108;
        bool r1016329 = r1016325 <= r1016328;
        double r1016330 = !r1016329;
        bool r1016331 = r1016327 || r1016330;
        double r1016332 = x;
        double r1016333 = z;
        double r1016334 = r1016332 - r1016333;
        double r1016335 = t;
        double r1016336 = r1016334 * r1016335;
        double r1016337 = r1016325 * r1016336;
        double r1016338 = r1016325 * r1016334;
        double r1016339 = r1016338 * r1016335;
        double r1016340 = r1016331 ? r1016337 : r1016339;
        return r1016340;
}

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
Herbie3.3
\[\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 y < -4.8561641122489593e-91 or 3.025418364347031e+108 < y

    1. Initial program 13.6

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified13.6

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right) \cdot t}\]
    3. Using strategy rm
    4. Applied pow113.6

      \[\leadsto \left(y \cdot \left(x - z\right)\right) \cdot \color{blue}{{t}^{1}}\]
    5. Applied pow113.6

      \[\leadsto \left(y \cdot \color{blue}{{\left(x - z\right)}^{1}}\right) \cdot {t}^{1}\]
    6. Applied pow113.6

      \[\leadsto \left(\color{blue}{{y}^{1}} \cdot {\left(x - z\right)}^{1}\right) \cdot {t}^{1}\]
    7. Applied pow-prod-down13.6

      \[\leadsto \color{blue}{{\left(y \cdot \left(x - z\right)\right)}^{1}} \cdot {t}^{1}\]
    8. Applied pow-prod-down13.6

      \[\leadsto \color{blue}{{\left(\left(y \cdot \left(x - z\right)\right) \cdot t\right)}^{1}}\]
    9. Simplified3.8

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

    if -4.8561641122489593e-91 < y < 3.025418364347031e+108

    1. Initial program 2.9

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -4.856164112248959329219151378456217111614 \cdot 10^{-91} \lor \neg \left(y \le 3.025418364347031062019168566536185959801 \cdot 10^{108}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(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))