Average Error: 6.8 → 0.3
Time: 11.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\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 = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\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 r554770 = x;
        double r554771 = y;
        double r554772 = r554770 * r554771;
        double r554773 = z;
        double r554774 = r554773 * r554771;
        double r554775 = r554772 - r554774;
        double r554776 = t;
        double r554777 = r554775 * r554776;
        return r554777;
}

double f(double x, double y, double z, double t) {
        double r554778 = x;
        double r554779 = y;
        double r554780 = r554778 * r554779;
        double r554781 = z;
        double r554782 = r554781 * r554779;
        double r554783 = r554780 - r554782;
        double r554784 = -inf.0;
        bool r554785 = r554783 <= r554784;
        double r554786 = -2.4567647858069996e-247;
        bool r554787 = r554783 <= r554786;
        double r554788 = 1.8871265358838337e-270;
        bool r554789 = r554783 <= r554788;
        double r554790 = !r554789;
        double r554791 = 2.097560004769073e+298;
        bool r554792 = r554783 <= r554791;
        bool r554793 = r554790 && r554792;
        bool r554794 = r554787 || r554793;
        double r554795 = !r554794;
        bool r554796 = r554785 || r554795;
        double r554797 = r554778 - r554781;
        double r554798 = t;
        double r554799 = r554797 * r554798;
        double r554800 = r554779 * r554799;
        double r554801 = r554783 * r554798;
        double r554802 = r554796 ? r554800 : r554801;
        return r554802;
}

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.0
Herbie0.3
\[\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)) < -inf.0 or -2.4567647858069996e-247 < (- (* x y) (* z y)) < 1.8871265358838337e-270 or 2.097560004769073e+298 < (- (* x y) (* z y))

    1. Initial program 38.1

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

      \[\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 -inf.0 < (- (* x y) (* z y)) < -2.4567647858069996e-247 or 1.8871265358838337e-270 < (- (* x y) (* z y)) < 2.097560004769073e+298

    1. Initial program 0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\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 2020046 +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))