Average Error: 7.0 → 0.7
Time: 2.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 -1.0572572003589838 \cdot 10^{263}:\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.76581883443859624 \cdot 10^{-94}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.45458001393067235 \cdot 10^{-192}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.44164105738549361 \cdot 10^{302}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -1.0572572003589838 \cdot 10^{263}:\\
\;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r484879 = x;
        double r484880 = y;
        double r484881 = r484879 * r484880;
        double r484882 = z;
        double r484883 = r484882 * r484880;
        double r484884 = r484881 - r484883;
        double r484885 = t;
        double r484886 = r484884 * r484885;
        return r484886;
}

double f(double x, double y, double z, double t) {
        double r484887 = x;
        double r484888 = y;
        double r484889 = r484887 * r484888;
        double r484890 = z;
        double r484891 = r484890 * r484888;
        double r484892 = r484889 - r484891;
        double r484893 = -1.0572572003589838e+263;
        bool r484894 = r484892 <= r484893;
        double r484895 = t;
        double r484896 = r484895 * r484888;
        double r484897 = r484887 - r484890;
        double r484898 = r484896 * r484897;
        double r484899 = 1.0;
        double r484900 = pow(r484898, r484899);
        double r484901 = -1.7658188344385962e-94;
        bool r484902 = r484892 <= r484901;
        double r484903 = r484892 * r484895;
        double r484904 = 1.4545800139306724e-192;
        bool r484905 = r484892 <= r484904;
        double r484906 = r484897 * r484895;
        double r484907 = r484888 * r484906;
        double r484908 = 2.4416410573854936e+302;
        bool r484909 = r484892 <= r484908;
        double r484910 = r484909 ? r484903 : r484900;
        double r484911 = r484905 ? r484907 : r484910;
        double r484912 = r484902 ? r484903 : r484911;
        double r484913 = r484894 ? r484900 : r484912;
        return r484913;
}

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.0
Herbie0.7
\[\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)) < -1.0572572003589838e+263 or 2.4416410573854936e+302 < (- (* x y) (* z y))

    1. Initial program 50.2

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

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

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

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

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

    if -1.0572572003589838e+263 < (- (* x y) (* z y)) < -1.7658188344385962e-94 or 1.4545800139306724e-192 < (- (* x y) (* z y)) < 2.4416410573854936e+302

    1. Initial program 0.2

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

    if -1.7658188344385962e-94 < (- (* x y) (* z y)) < 1.4545800139306724e-192

    1. Initial program 5.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -1.0572572003589838 \cdot 10^{263}:\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.76581883443859624 \cdot 10^{-94}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.45458001393067235 \cdot 10^{-192}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 2.44164105738549361 \cdot 10^{302}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \end{array}\]

Reproduce

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