Average Error: 7.0 → 2.7
Time: 17.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -3740229.056606153957545757293701171875 \lor \neg \left(y \le 1.667823963409600890266108345717263305269 \cdot 10^{-56}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(x - z\right) \cdot y\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -3740229.056606153957545757293701171875 \lor \neg \left(y \le 1.667823963409600890266108345717263305269 \cdot 10^{-56}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r273721 = x;
        double r273722 = y;
        double r273723 = r273721 * r273722;
        double r273724 = z;
        double r273725 = r273724 * r273722;
        double r273726 = r273723 - r273725;
        double r273727 = t;
        double r273728 = r273726 * r273727;
        return r273728;
}

double f(double x, double y, double z, double t) {
        double r273729 = y;
        double r273730 = -3740229.056606154;
        bool r273731 = r273729 <= r273730;
        double r273732 = 1.667823963409601e-56;
        bool r273733 = r273729 <= r273732;
        double r273734 = !r273733;
        bool r273735 = r273731 || r273734;
        double r273736 = x;
        double r273737 = z;
        double r273738 = r273736 - r273737;
        double r273739 = t;
        double r273740 = r273738 * r273739;
        double r273741 = r273729 * r273740;
        double r273742 = r273738 * r273729;
        double r273743 = r273739 * r273742;
        double r273744 = r273735 ? r273741 : r273743;
        return r273744;
}

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.0
Target3.2
Herbie2.7
\[\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 < -3740229.056606154 or 1.667823963409601e-56 < y

    1. Initial program 13.5

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

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

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

    if -3740229.056606154 < y < 1.667823963409601e-56

    1. Initial program 2.1

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

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right) \cdot t}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity2.1

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

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

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

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

Reproduce

herbie shell --seed 2019322 +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.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))

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