Average Error: 7.1 → 3.5
Time: 14.0s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -7.874814358430000978416727631879738868975 \cdot 10^{151} \lor \neg \left(t \le 138114513393605188517888\right):\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -7.874814358430000978416727631879738868975 \cdot 10^{151} \lor \neg \left(t \le 138114513393605188517888\right):\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r452276 = x;
        double r452277 = y;
        double r452278 = r452276 * r452277;
        double r452279 = z;
        double r452280 = r452279 * r452277;
        double r452281 = r452278 - r452280;
        double r452282 = t;
        double r452283 = r452281 * r452282;
        return r452283;
}

double f(double x, double y, double z, double t) {
        double r452284 = t;
        double r452285 = -7.874814358430001e+151;
        bool r452286 = r452284 <= r452285;
        double r452287 = 1.3811451339360519e+23;
        bool r452288 = r452284 <= r452287;
        double r452289 = !r452288;
        bool r452290 = r452286 || r452289;
        double r452291 = y;
        double r452292 = r452291 * r452284;
        double r452293 = x;
        double r452294 = z;
        double r452295 = r452293 - r452294;
        double r452296 = r452292 * r452295;
        double r452297 = r452284 * r452295;
        double r452298 = r452291 * r452297;
        double r452299 = r452290 ? r452296 : r452298;
        return r452299;
}

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

Original7.1
Target3.1
Herbie3.5
\[\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 t < -7.874814358430001e+151 or 1.3811451339360519e+23 < t

    1. Initial program 3.6

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

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

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

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

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

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

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

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

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

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

    if -7.874814358430001e+151 < t < 1.3811451339360519e+23

    1. Initial program 8.3

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

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

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

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

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

Reproduce

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