Average Error: 7.1 → 0.5
Time: 11.5s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -2.112605073419438906656738477879925446144 \cdot 10^{293}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.915495002659053232957672250858607769431 \cdot 10^{-133}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.719546404882711300932688246576743977043 \cdot 10^{-292}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.281447287153549320457976819327732070409 \cdot 10^{192}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \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 \le -2.112605073419438906656738477879925446144 \cdot 10^{293}:\\
\;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r23804852 = x;
        double r23804853 = y;
        double r23804854 = r23804852 * r23804853;
        double r23804855 = z;
        double r23804856 = r23804855 * r23804853;
        double r23804857 = r23804854 - r23804856;
        double r23804858 = t;
        double r23804859 = r23804857 * r23804858;
        return r23804859;
}

double f(double x, double y, double z, double t) {
        double r23804860 = x;
        double r23804861 = y;
        double r23804862 = r23804860 * r23804861;
        double r23804863 = z;
        double r23804864 = r23804863 * r23804861;
        double r23804865 = r23804862 - r23804864;
        double r23804866 = -2.112605073419439e+293;
        bool r23804867 = r23804865 <= r23804866;
        double r23804868 = t;
        double r23804869 = r23804860 - r23804863;
        double r23804870 = r23804868 * r23804869;
        double r23804871 = r23804870 * r23804861;
        double r23804872 = -4.915495002659053e-133;
        bool r23804873 = r23804865 <= r23804872;
        double r23804874 = r23804868 * r23804865;
        double r23804875 = 1.7195464048827113e-292;
        bool r23804876 = r23804865 <= r23804875;
        double r23804877 = 9.28144728715355e+192;
        bool r23804878 = r23804865 <= r23804877;
        double r23804879 = r23804861 * r23804868;
        double r23804880 = r23804869 * r23804879;
        double r23804881 = r23804878 ? r23804874 : r23804880;
        double r23804882 = r23804876 ? r23804871 : r23804881;
        double r23804883 = r23804873 ? r23804874 : r23804882;
        double r23804884 = r23804867 ? r23804871 : r23804883;
        return r23804884;
}

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.1
Target2.9
Herbie0.5
\[\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 3 regimes
  2. if (- (* x y) (* z y)) < -2.112605073419439e+293 or -4.915495002659053e-133 < (- (* x y) (* z y)) < 1.7195464048827113e-292

    1. Initial program 19.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified1.3

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

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

    if -2.112605073419439e+293 < (- (* x y) (* z y)) < -4.915495002659053e-133 or 1.7195464048827113e-292 < (- (* x y) (* z y)) < 9.28144728715355e+192

    1. Initial program 0.2

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

    if 9.28144728715355e+192 < (- (* x y) (* z y))

    1. Initial program 29.1

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified0.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -2.112605073419438906656738477879925446144 \cdot 10^{293}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.915495002659053232957672250858607769431 \cdot 10^{-133}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.719546404882711300932688246576743977043 \cdot 10^{-292}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.281447287153549320457976819327732070409 \cdot 10^{192}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019192 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"

  :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))