Average Error: 6.9 → 0.3
Time: 4.8s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.3289707772072372 \cdot 10^{-295}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.59306900671491 \cdot 10^{-312}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.42617537231530687 \cdot 10^{235}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r558698 = x;
        double r558699 = y;
        double r558700 = r558698 * r558699;
        double r558701 = z;
        double r558702 = r558701 * r558699;
        double r558703 = r558700 - r558702;
        double r558704 = t;
        double r558705 = r558703 * r558704;
        return r558705;
}

double f(double x, double y, double z, double t) {
        double r558706 = x;
        double r558707 = y;
        double r558708 = r558706 * r558707;
        double r558709 = z;
        double r558710 = r558709 * r558707;
        double r558711 = r558708 - r558710;
        double r558712 = -inf.0;
        bool r558713 = r558711 <= r558712;
        double r558714 = t;
        double r558715 = r558714 * r558707;
        double r558716 = r558706 - r558709;
        double r558717 = r558715 * r558716;
        double r558718 = -4.328970777207237e-295;
        bool r558719 = r558711 <= r558718;
        double r558720 = r558711 * r558714;
        double r558721 = 7.5930690067149e-312;
        bool r558722 = r558711 <= r558721;
        double r558723 = 7.426175372315307e+235;
        bool r558724 = r558711 <= r558723;
        double r558725 = r558716 * r558714;
        double r558726 = r558707 * r558725;
        double r558727 = r558724 ? r558720 : r558726;
        double r558728 = r558722 ? r558717 : r558727;
        double r558729 = r558719 ? r558720 : r558728;
        double r558730 = r558713 ? r558717 : r558729;
        return r558730;
}

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.3
\[\begin{array}{l} \mathbf{if}\;t \lt -9.2318795828867769 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.5430670515648771 \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)) < -inf.0 or -4.328970777207237e-295 < (- (* x y) (* z y)) < 7.5930690067149e-312

    1. Initial program 38.1

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

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{x \cdot y - z \cdot y} \cdot \sqrt[3]{x \cdot y - z \cdot y}\right) \cdot \left(\sqrt[3]{x \cdot y - z \cdot y} \cdot t\right)}\]
    5. Taylor expanded around inf 38.1

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

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

    if -inf.0 < (- (* x y) (* z y)) < -4.328970777207237e-295 or 7.5930690067149e-312 < (- (* x y) (* z y)) < 7.426175372315307e+235

    1. Initial program 0.2

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

    if 7.426175372315307e+235 < (- (* x y) (* z y))

    1. Initial program 35.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.3289707772072372 \cdot 10^{-295}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.59306900671491 \cdot 10^{-312}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 7.42617537231530687 \cdot 10^{235}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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