Average Error: 6.8 → 1.4
Time: 4.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 -4.63836268060687826 \cdot 10^{307} \lor \neg \left(x \cdot y - z \cdot y \le 1.95547411306134 \cdot 10^{248}\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}\;x \cdot y - z \cdot y \le -4.63836268060687826 \cdot 10^{307} \lor \neg \left(x \cdot y - z \cdot y \le 1.95547411306134 \cdot 10^{248}\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 r504689 = x;
        double r504690 = y;
        double r504691 = r504689 * r504690;
        double r504692 = z;
        double r504693 = r504692 * r504690;
        double r504694 = r504691 - r504693;
        double r504695 = t;
        double r504696 = r504694 * r504695;
        return r504696;
}

double f(double x, double y, double z, double t) {
        double r504697 = x;
        double r504698 = y;
        double r504699 = r504697 * r504698;
        double r504700 = z;
        double r504701 = r504700 * r504698;
        double r504702 = r504699 - r504701;
        double r504703 = -4.638362680606878e+307;
        bool r504704 = r504702 <= r504703;
        double r504705 = 1.955474113061338e+248;
        bool r504706 = r504702 <= r504705;
        double r504707 = !r504706;
        bool r504708 = r504704 || r504707;
        double r504709 = r504697 - r504700;
        double r504710 = t;
        double r504711 = r504709 * r504710;
        double r504712 = r504698 * r504711;
        double r504713 = r504702 * r504710;
        double r504714 = r504708 ? r504712 : r504713;
        return r504714;
}

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

Original6.8
Target3.1
Herbie1.4
\[\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)) < -4.638362680606878e+307 or 1.955474113061338e+248 < (- (* x y) (* z y))

    1. Initial program 47.9

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

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

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

    if -4.638362680606878e+307 < (- (* x y) (* z y)) < 1.955474113061338e+248

    1. Initial program 1.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -4.63836268060687826 \cdot 10^{307} \lor \neg \left(x \cdot y - z \cdot y \le 1.95547411306134 \cdot 10^{248}\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 2020062 
(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))