Average Error: 7.7 → 1.3
Time: 8.4s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le -1.5183126872605908 \cdot 10^{-155} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 5.5589845878545276 \cdot 10^{51} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 1.0975945066549479 \cdot 10^{307}\right)\right)\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\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}\;\left(x \cdot y - z \cdot y\right) \cdot t = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le -1.5183126872605908 \cdot 10^{-155} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 5.5589845878545276 \cdot 10^{51} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 1.0975945066549479 \cdot 10^{307}\right)\right)\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\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 r2901 = x;
        double r2902 = y;
        double r2903 = r2901 * r2902;
        double r2904 = z;
        double r2905 = r2904 * r2902;
        double r2906 = r2903 - r2905;
        double r2907 = t;
        double r2908 = r2906 * r2907;
        return r2908;
}

double f(double x, double y, double z, double t) {
        double r2909 = x;
        double r2910 = y;
        double r2911 = r2909 * r2910;
        double r2912 = z;
        double r2913 = r2912 * r2910;
        double r2914 = r2911 - r2913;
        double r2915 = t;
        double r2916 = r2914 * r2915;
        double r2917 = -inf.0;
        bool r2918 = r2916 <= r2917;
        double r2919 = -1.5183126872605908e-155;
        bool r2920 = r2916 <= r2919;
        double r2921 = 5.5589845878545276e+51;
        bool r2922 = r2916 <= r2921;
        double r2923 = 1.0975945066549479e+307;
        bool r2924 = r2916 <= r2923;
        double r2925 = !r2924;
        bool r2926 = r2922 || r2925;
        double r2927 = !r2926;
        bool r2928 = r2920 || r2927;
        double r2929 = !r2928;
        bool r2930 = r2918 || r2929;
        double r2931 = r2909 - r2912;
        double r2932 = r2931 * r2915;
        double r2933 = r2910 * r2932;
        double r2934 = r2930 ? r2933 : r2916;
        return r2934;
}

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.7
Target3.0
Herbie1.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 2 regimes
  2. if (* (- (* x y) (* z y)) t) < -inf.0 or -1.5183126872605908e-155 < (* (- (* x y) (* z y)) t) < 5.5589845878545276e+51 or 1.0975945066549479e+307 < (* (- (* x y) (* z y)) t)

    1. Initial program 15.0

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

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

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

    if -inf.0 < (* (- (* x y) (* z y)) t) < -1.5183126872605908e-155 or 5.5589845878545276e+51 < (* (- (* x y) (* z y)) t) < 1.0975945066549479e+307

    1. Initial program 0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le -1.5183126872605908 \cdot 10^{-155} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 5.5589845878545276 \cdot 10^{51} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 1.0975945066549479 \cdot 10^{307}\right)\right)\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

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