Average Error: 7.5 → 1.9
Time: 14.9s
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.475976711779892361755404204358771985379 \cdot 10^{215} \lor \neg \left(x \cdot y - z \cdot y \le 1.409317556130136785534646521302262345564 \cdot 10^{137}\right):\\ \;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\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.475976711779892361755404204358771985379 \cdot 10^{215} \lor \neg \left(x \cdot y - z \cdot y \le 1.409317556130136785534646521302262345564 \cdot 10^{137}\right):\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\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 r374253 = x;
        double r374254 = y;
        double r374255 = r374253 * r374254;
        double r374256 = z;
        double r374257 = r374256 * r374254;
        double r374258 = r374255 - r374257;
        double r374259 = t;
        double r374260 = r374258 * r374259;
        return r374260;
}

double f(double x, double y, double z, double t) {
        double r374261 = x;
        double r374262 = y;
        double r374263 = r374261 * r374262;
        double r374264 = z;
        double r374265 = r374264 * r374262;
        double r374266 = r374263 - r374265;
        double r374267 = -4.475976711779892e+215;
        bool r374268 = r374266 <= r374267;
        double r374269 = 1.4093175561301368e+137;
        bool r374270 = r374266 <= r374269;
        double r374271 = !r374270;
        bool r374272 = r374268 || r374271;
        double r374273 = r374261 - r374264;
        double r374274 = t;
        double r374275 = r374274 * r374262;
        double r374276 = r374273 * r374275;
        double r374277 = r374266 * r374274;
        double r374278 = r374272 ? r374276 : r374277;
        return r374278;
}

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.5
Target3.2
Herbie1.9
\[\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.475976711779892e+215 or 1.4093175561301368e+137 < (- (* x y) (* z y))

    1. Initial program 24.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied add-cube-cbrt25.4

      \[\leadsto \left(x \cdot y - z \cdot y\right) \cdot \color{blue}{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right)}\]
    4. Applied associate-*r*25.4

      \[\leadsto \color{blue}{\left(\left(x \cdot y - z \cdot y\right) \cdot \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right) \cdot \sqrt[3]{t}}\]
    5. Simplified25.4

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

      \[\leadsto \left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(y \cdot \left(x - z\right)\right)\right) \cdot \color{blue}{{\left(\sqrt[3]{t}\right)}^{1}}\]
    8. Applied pow125.4

      \[\leadsto \left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(y \cdot \color{blue}{{\left(x - z\right)}^{1}}\right)\right) \cdot {\left(\sqrt[3]{t}\right)}^{1}\]
    9. Applied pow125.4

      \[\leadsto \left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(\color{blue}{{y}^{1}} \cdot {\left(x - z\right)}^{1}\right)\right) \cdot {\left(\sqrt[3]{t}\right)}^{1}\]
    10. Applied pow-prod-down25.4

      \[\leadsto \left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \color{blue}{{\left(y \cdot \left(x - z\right)\right)}^{1}}\right) \cdot {\left(\sqrt[3]{t}\right)}^{1}\]
    11. Applied pow125.4

      \[\leadsto \left(\left(\sqrt[3]{t} \cdot \color{blue}{{\left(\sqrt[3]{t}\right)}^{1}}\right) \cdot {\left(y \cdot \left(x - z\right)\right)}^{1}\right) \cdot {\left(\sqrt[3]{t}\right)}^{1}\]
    12. Applied pow125.4

      \[\leadsto \left(\left(\color{blue}{{\left(\sqrt[3]{t}\right)}^{1}} \cdot {\left(\sqrt[3]{t}\right)}^{1}\right) \cdot {\left(y \cdot \left(x - z\right)\right)}^{1}\right) \cdot {\left(\sqrt[3]{t}\right)}^{1}\]
    13. Applied pow-prod-down25.4

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)}^{1}} \cdot {\left(y \cdot \left(x - z\right)\right)}^{1}\right) \cdot {\left(\sqrt[3]{t}\right)}^{1}\]
    14. Applied pow-prod-down25.4

      \[\leadsto \color{blue}{{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(y \cdot \left(x - z\right)\right)\right)}^{1}} \cdot {\left(\sqrt[3]{t}\right)}^{1}\]
    15. Applied pow-prod-down25.4

      \[\leadsto \color{blue}{{\left(\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(y \cdot \left(x - z\right)\right)\right) \cdot \sqrt[3]{t}\right)}^{1}}\]
    16. Simplified25.4

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

      \[\leadsto {\left(\color{blue}{\left(1 \cdot {\left(\sqrt[3]{t}\right)}^{3}\right)} \cdot \left(y \cdot \left(x - z\right)\right)\right)}^{1}\]
    19. Applied associate-*l*25.4

      \[\leadsto {\color{blue}{\left(1 \cdot \left({\left(\sqrt[3]{t}\right)}^{3} \cdot \left(y \cdot \left(x - z\right)\right)\right)\right)}}^{1}\]
    20. Simplified1.9

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

    if -4.475976711779892e+215 < (- (* x y) (* z y)) < 1.4093175561301368e+137

    1. Initial program 2.0

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

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

Reproduce

herbie shell --seed 2019305 +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))