Average Error: 7.2 → 2.0
Time: 3.3s
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 \le -6.90503745471781065 \cdot 10^{-4} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 7.0704745665399515 \cdot 10^{298}\right):\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \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 \le -6.90503745471781065 \cdot 10^{-4} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 7.0704745665399515 \cdot 10^{298}\right):\\
\;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\

\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 r527703 = x;
        double r527704 = y;
        double r527705 = r527703 * r527704;
        double r527706 = z;
        double r527707 = r527706 * r527704;
        double r527708 = r527705 - r527707;
        double r527709 = t;
        double r527710 = r527708 * r527709;
        return r527710;
}

double f(double x, double y, double z, double t) {
        double r527711 = x;
        double r527712 = y;
        double r527713 = r527711 * r527712;
        double r527714 = z;
        double r527715 = r527714 * r527712;
        double r527716 = r527713 - r527715;
        double r527717 = t;
        double r527718 = r527716 * r527717;
        double r527719 = -0.0006905037454717811;
        bool r527720 = r527718 <= r527719;
        double r527721 = 7.0704745665399515e+298;
        bool r527722 = r527718 <= r527721;
        double r527723 = !r527722;
        bool r527724 = r527720 || r527723;
        double r527725 = r527717 * r527712;
        double r527726 = r527711 - r527714;
        double r527727 = r527725 * r527726;
        double r527728 = 1.0;
        double r527729 = pow(r527727, r527728);
        double r527730 = r527724 ? r527729 : r527718;
        return r527730;
}

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.1
Herbie2.0
\[\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) < -0.0006905037454717811 or 7.0704745665399515e+298 < (* (- (* x y) (* z y)) t)

    1. Initial program 19.2

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

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

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

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

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

    if -0.0006905037454717811 < (* (- (* x y) (* z y)) t) < 7.0704745665399515e+298

    1. Initial program 1.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -6.90503745471781065 \cdot 10^{-4} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 7.0704745665399515 \cdot 10^{298}\right):\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

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