Average Error: 7.2 → 2.8
Time: 16.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.065299954859988311499887353720063452684 \cdot 10^{-58} \lor \neg \left(t \le 6.967834390730040069510902551400827187322 \cdot 10^{-9}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\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}\;t \le -2.065299954859988311499887353720063452684 \cdot 10^{-58} \lor \neg \left(t \le 6.967834390730040069510902551400827187322 \cdot 10^{-9}\right):\\
\;\;\;\;\left(y \cdot \left(x - z\right)\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 r357891 = x;
        double r357892 = y;
        double r357893 = r357891 * r357892;
        double r357894 = z;
        double r357895 = r357894 * r357892;
        double r357896 = r357893 - r357895;
        double r357897 = t;
        double r357898 = r357896 * r357897;
        return r357898;
}

double f(double x, double y, double z, double t) {
        double r357899 = t;
        double r357900 = -2.0652999548599883e-58;
        bool r357901 = r357899 <= r357900;
        double r357902 = 6.96783439073004e-09;
        bool r357903 = r357899 <= r357902;
        double r357904 = !r357903;
        bool r357905 = r357901 || r357904;
        double r357906 = y;
        double r357907 = x;
        double r357908 = z;
        double r357909 = r357907 - r357908;
        double r357910 = r357906 * r357909;
        double r357911 = r357910 * r357899;
        double r357912 = r357909 * r357899;
        double r357913 = r357906 * r357912;
        double r357914 = r357905 ? r357911 : r357913;
        return r357914;
}

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.2
Target3.2
Herbie2.8
\[\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 t < -2.0652999548599883e-58 or 6.96783439073004e-09 < t

    1. Initial program 3.6

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified3.6

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

    if -2.0652999548599883e-58 < t < 6.96783439073004e-09

    1. Initial program 10.0

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified10.0

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.065299954859988311499887353720063452684 \cdot 10^{-58} \lor \neg \left(t \le 6.967834390730040069510902551400827187322 \cdot 10^{-9}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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