Average Error: 7.0 → 3.0
Time: 17.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -3.125987808896981841012203791423557065046 \cdot 10^{-142} \lor \neg \left(y \le 134279464056616382181146624\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - z\right) \cdot y\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -3.125987808896981841012203791423557065046 \cdot 10^{-142} \lor \neg \left(y \le 134279464056616382181146624\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r309694 = x;
        double r309695 = y;
        double r309696 = r309694 * r309695;
        double r309697 = z;
        double r309698 = r309697 * r309695;
        double r309699 = r309696 - r309698;
        double r309700 = t;
        double r309701 = r309699 * r309700;
        return r309701;
}

double f(double x, double y, double z, double t) {
        double r309702 = y;
        double r309703 = -3.125987808896982e-142;
        bool r309704 = r309702 <= r309703;
        double r309705 = 1.3427946405661638e+26;
        bool r309706 = r309702 <= r309705;
        double r309707 = !r309706;
        bool r309708 = r309704 || r309707;
        double r309709 = x;
        double r309710 = z;
        double r309711 = r309709 - r309710;
        double r309712 = t;
        double r309713 = r309711 * r309712;
        double r309714 = r309702 * r309713;
        double r309715 = r309711 * r309702;
        double r309716 = r309715 * r309712;
        double r309717 = r309708 ? r309714 : r309716;
        return r309717;
}

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.1
Herbie3.0
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886776938073886590448747944753 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877116200336808272775217995 \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 y < -3.125987808896982e-142 or 1.3427946405661638e+26 < y

    1. Initial program 11.8

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified11.8

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

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

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

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

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

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

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

    if -3.125987808896982e-142 < y < 1.3427946405661638e+26

    1. Initial program 2.1

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.1

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(y \cdot \left(\left(x - z\right) \cdot t\right)\right)}}^{1}\]
    10. Using strategy rm
    11. Applied add-cube-cbrt10.3

      \[\leadsto {\left(y \cdot \left(\left(x - z\right) \cdot \color{blue}{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right)}\right)\right)}^{1}\]
    12. Applied associate-*r*10.3

      \[\leadsto {\left(y \cdot \color{blue}{\left(\left(\left(x - z\right) \cdot \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right) \cdot \sqrt[3]{t}\right)}\right)}^{1}\]
    13. Taylor expanded around inf 2.1

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

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

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

Reproduce

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