Average Error: 7.0 → 2.7
Time: 4.1s
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 -2.07332382151466336 \cdot 10^{-64} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 8.07797671743811923 \cdot 10^{-51}\right):\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \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}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -2.07332382151466336 \cdot 10^{-64} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 8.07797671743811923 \cdot 10^{-51}\right):\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

\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 r552826 = x;
        double r552827 = y;
        double r552828 = r552826 * r552827;
        double r552829 = z;
        double r552830 = r552829 * r552827;
        double r552831 = r552828 - r552830;
        double r552832 = t;
        double r552833 = r552831 * r552832;
        return r552833;
}

double f(double x, double y, double z, double t) {
        double r552834 = x;
        double r552835 = y;
        double r552836 = r552834 * r552835;
        double r552837 = z;
        double r552838 = r552837 * r552835;
        double r552839 = r552836 - r552838;
        double r552840 = t;
        double r552841 = r552839 * r552840;
        double r552842 = -2.0733238215146634e-64;
        bool r552843 = r552841 <= r552842;
        double r552844 = 8.077976717438119e-51;
        bool r552845 = r552841 <= r552844;
        double r552846 = !r552845;
        bool r552847 = r552843 || r552846;
        double r552848 = r552835 * r552840;
        double r552849 = r552834 - r552837;
        double r552850 = r552848 * r552849;
        double r552851 = r552849 * r552840;
        double r552852 = r552835 * r552851;
        double r552853 = r552847 ? r552850 : r552852;
        return r552853;
}

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.0
Target3.0
Herbie2.7
\[\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) < -2.0733238215146634e-64 or 8.077976717438119e-51 < (* (- (* x y) (* z y)) t)

    1. Initial program 9.6

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(x - z\right) \cdot t\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt11.4

      \[\leadsto y \cdot \left(\color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \sqrt[3]{x - z}\right)} \cdot t\right)\]
    7. Applied associate-*l*11.4

      \[\leadsto y \cdot \color{blue}{\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right)}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt11.7

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right)\]
    10. Applied associate-*l*11.7

      \[\leadsto \color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\right)\right)}\]
    11. Simplified7.3

      \[\leadsto \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{y} \cdot t\right) \cdot \left(x - z\right)\right)}\]
    12. Using strategy rm
    13. Applied associate-*r*3.8

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot t\right)\right) \cdot \left(x - z\right)}\]
    14. Simplified2.8

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

    if -2.0733238215146634e-64 < (* (- (* x y) (* z y)) t) < 8.077976717438119e-51

    1. Initial program 2.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t \le -2.07332382151466336 \cdot 10^{-64} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 8.07797671743811923 \cdot 10^{-51}\right):\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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