Average Error: 7.2 → 2.8
Time: 17.5s
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 r413799 = x;
        double r413800 = y;
        double r413801 = r413799 * r413800;
        double r413802 = z;
        double r413803 = r413802 * r413800;
        double r413804 = r413801 - r413803;
        double r413805 = t;
        double r413806 = r413804 * r413805;
        return r413806;
}

double f(double x, double y, double z, double t) {
        double r413807 = t;
        double r413808 = -2.0652999548599883e-58;
        bool r413809 = r413807 <= r413808;
        double r413810 = 6.96783439073004e-09;
        bool r413811 = r413807 <= r413810;
        double r413812 = !r413811;
        bool r413813 = r413809 || r413812;
        double r413814 = y;
        double r413815 = x;
        double r413816 = z;
        double r413817 = r413815 - r413816;
        double r413818 = r413814 * r413817;
        double r413819 = r413818 * r413807;
        double r413820 = r413817 * r413807;
        double r413821 = r413814 * r413820;
        double r413822 = r413813 ? r413819 : r413821;
        return r413822;
}

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