Average Error: 2.1 → 1.6
Time: 5.0s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.1022940386055277 \cdot 10^{-35}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 0.0:\\ \;\;\;\;1 \cdot \left(\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\right)\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 5.14189203863818796 \cdot 10^{189}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\left(x - y\right) \cdot \frac{t}{z - y}\right)\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \le -1.1022940386055277 \cdot 10^{-35}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

\mathbf{elif}\;\frac{x - y}{z - y} \le 0.0:\\
\;\;\;\;1 \cdot \left(\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\right)\\

\mathbf{elif}\;\frac{x - y}{z - y} \le 5.14189203863818796 \cdot 10^{189}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r562864 = x;
        double r562865 = y;
        double r562866 = r562864 - r562865;
        double r562867 = z;
        double r562868 = r562867 - r562865;
        double r562869 = r562866 / r562868;
        double r562870 = t;
        double r562871 = r562869 * r562870;
        return r562871;
}

double f(double x, double y, double z, double t) {
        double r562872 = x;
        double r562873 = y;
        double r562874 = r562872 - r562873;
        double r562875 = z;
        double r562876 = r562875 - r562873;
        double r562877 = r562874 / r562876;
        double r562878 = -1.1022940386055277e-35;
        bool r562879 = r562877 <= r562878;
        double r562880 = t;
        double r562881 = r562877 * r562880;
        double r562882 = 0.0;
        bool r562883 = r562877 <= r562882;
        double r562884 = 1.0;
        double r562885 = r562874 * r562880;
        double r562886 = r562884 / r562876;
        double r562887 = r562885 * r562886;
        double r562888 = r562884 * r562887;
        double r562889 = 5.141892038638188e+189;
        bool r562890 = r562877 <= r562889;
        double r562891 = r562880 / r562876;
        double r562892 = r562874 * r562891;
        double r562893 = r562884 * r562892;
        double r562894 = r562890 ? r562881 : r562893;
        double r562895 = r562883 ? r562888 : r562894;
        double r562896 = r562879 ? r562881 : r562895;
        return r562896;
}

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

Original2.1
Target2.1
Herbie1.6
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (- x y) (- z y)) < -1.1022940386055277e-35 or 0.0 < (/ (- x y) (- z y)) < 5.141892038638188e+189

    1. Initial program 0.8

      \[\frac{x - y}{z - y} \cdot t\]

    if -1.1022940386055277e-35 < (/ (- x y) (- z y)) < 0.0

    1. Initial program 5.6

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity5.6

      \[\leadsto \frac{x - y}{\color{blue}{1 \cdot \left(z - y\right)}} \cdot t\]
    4. Applied add-cube-cbrt6.2

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \sqrt[3]{x - y}}}{1 \cdot \left(z - y\right)} \cdot t\]
    5. Applied times-frac6.2

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

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

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

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

      \[\leadsto 1 \cdot \color{blue}{\left(\left(x - y\right) \cdot \frac{t}{z - y}\right)}\]
    11. Using strategy rm
    12. Applied div-inv4.9

      \[\leadsto 1 \cdot \left(\left(x - y\right) \cdot \color{blue}{\left(t \cdot \frac{1}{z - y}\right)}\right)\]
    13. Applied associate-*r*5.3

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

    if 5.141892038638188e+189 < (/ (- x y) (- z y))

    1. Initial program 14.6

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity14.6

      \[\leadsto \frac{x - y}{\color{blue}{1 \cdot \left(z - y\right)}} \cdot t\]
    4. Applied add-cube-cbrt15.3

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \sqrt[3]{x - y}}}{1 \cdot \left(z - y\right)} \cdot t\]
    5. Applied times-frac15.3

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1} \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity3.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.1022940386055277 \cdot 10^{-35}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 0.0:\\ \;\;\;\;1 \cdot \left(\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\right)\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 5.14189203863818796 \cdot 10^{189}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\left(x - y\right) \cdot \frac{t}{z - y}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020081 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))