Average Error: 7.1 → 2.5
Time: 3.6s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -6648838448.446291 \lor \neg \left(t \le 6.1434809147908996 \cdot 10^{33}\right):\\ \;\;\;\;t \cdot \left(x \cdot y\right) + \left(-t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(t \cdot \left(x - z\right)\right) \cdot y\right)}^{1}\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -6648838448.446291 \lor \neg \left(t \le 6.1434809147908996 \cdot 10^{33}\right):\\
\;\;\;\;t \cdot \left(x \cdot y\right) + \left(-t \cdot \left(z \cdot y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;{\left(\left(t \cdot \left(x - z\right)\right) \cdot y\right)}^{1}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r600951 = x;
        double r600952 = y;
        double r600953 = r600951 * r600952;
        double r600954 = z;
        double r600955 = r600954 * r600952;
        double r600956 = r600953 - r600955;
        double r600957 = t;
        double r600958 = r600956 * r600957;
        return r600958;
}

double f(double x, double y, double z, double t) {
        double r600959 = t;
        double r600960 = -6648838448.446291;
        bool r600961 = r600959 <= r600960;
        double r600962 = 6.1434809147909e+33;
        bool r600963 = r600959 <= r600962;
        double r600964 = !r600963;
        bool r600965 = r600961 || r600964;
        double r600966 = x;
        double r600967 = y;
        double r600968 = r600966 * r600967;
        double r600969 = r600959 * r600968;
        double r600970 = z;
        double r600971 = r600970 * r600967;
        double r600972 = r600959 * r600971;
        double r600973 = -r600972;
        double r600974 = r600969 + r600973;
        double r600975 = r600966 - r600970;
        double r600976 = r600959 * r600975;
        double r600977 = r600976 * r600967;
        double r600978 = 1.0;
        double r600979 = pow(r600977, r600978);
        double r600980 = r600965 ? r600974 : r600979;
        return r600980;
}

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.1
Target3.2
Herbie2.5
\[\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 t < -6648838448.446291 or 6.1434809147909e+33 < t

    1. Initial program 3.4

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified3.4

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

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

      \[\leadsto t \cdot \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(x - z\right)\right)\right)}\]
    6. Using strategy rm
    7. Applied sub-neg4.5

      \[\leadsto t \cdot \left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \color{blue}{\left(x + \left(-z\right)\right)}\right)\right)\]
    8. Applied distribute-lft-in4.5

      \[\leadsto t \cdot \left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \color{blue}{\left(\sqrt[3]{y} \cdot x + \sqrt[3]{y} \cdot \left(-z\right)\right)}\right)\]
    9. Applied distribute-lft-in4.5

      \[\leadsto t \cdot \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot x\right) + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(-z\right)\right)\right)}\]
    10. Applied distribute-lft-in4.5

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

      \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} + t \cdot \left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(-z\right)\right)\right)\]
    12. Simplified3.4

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

    if -6648838448.446291 < t < 6.1434809147909e+33

    1. Initial program 9.0

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified9.0

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

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

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

      \[\leadsto t \cdot \left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \color{blue}{{\left(x - z\right)}^{1}}\right)\right)\]
    8. Applied pow19.8

      \[\leadsto t \cdot \left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{1}} \cdot {\left(x - z\right)}^{1}\right)\right)\]
    9. Applied pow-prod-down9.8

      \[\leadsto t \cdot \left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \color{blue}{{\left(\sqrt[3]{y} \cdot \left(x - z\right)\right)}^{1}}\right)\]
    10. Applied pow19.8

      \[\leadsto t \cdot \left(\left(\sqrt[3]{y} \cdot \color{blue}{{\left(\sqrt[3]{y}\right)}^{1}}\right) \cdot {\left(\sqrt[3]{y} \cdot \left(x - z\right)\right)}^{1}\right)\]
    11. Applied pow19.8

      \[\leadsto t \cdot \left(\left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{1}} \cdot {\left(\sqrt[3]{y}\right)}^{1}\right) \cdot {\left(\sqrt[3]{y} \cdot \left(x - z\right)\right)}^{1}\right)\]
    12. Applied pow-prod-down9.8

      \[\leadsto t \cdot \left(\color{blue}{{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}^{1}} \cdot {\left(\sqrt[3]{y} \cdot \left(x - z\right)\right)}^{1}\right)\]
    13. Applied pow-prod-down9.8

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

      \[\leadsto \color{blue}{{t}^{1}} \cdot {\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(x - z\right)\right)\right)}^{1}\]
    15. Applied pow-prod-down9.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6648838448.446291 \lor \neg \left(t \le 6.1434809147908996 \cdot 10^{33}\right):\\ \;\;\;\;t \cdot \left(x \cdot y\right) + \left(-t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(t \cdot \left(x - z\right)\right) \cdot y\right)}^{1}\\ \end{array}\]

Reproduce

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