Average Error: 2.2 → 1.2
Time: 37.3s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.3538191510586175 \cdot 10^{-253}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 7.5690856942879 \cdot 10^{-321}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \le -1.3538191510586175 \cdot 10^{-253}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\

\mathbf{elif}\;\frac{x - y}{z - y} \le 7.5690856942879 \cdot 10^{-321}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r19060854 = x;
        double r19060855 = y;
        double r19060856 = r19060854 - r19060855;
        double r19060857 = z;
        double r19060858 = r19060857 - r19060855;
        double r19060859 = r19060856 / r19060858;
        double r19060860 = t;
        double r19060861 = r19060859 * r19060860;
        return r19060861;
}

double f(double x, double y, double z, double t) {
        double r19060862 = x;
        double r19060863 = y;
        double r19060864 = r19060862 - r19060863;
        double r19060865 = z;
        double r19060866 = r19060865 - r19060863;
        double r19060867 = r19060864 / r19060866;
        double r19060868 = -1.3538191510586175e-253;
        bool r19060869 = r19060867 <= r19060868;
        double r19060870 = t;
        double r19060871 = r19060866 / r19060864;
        double r19060872 = r19060870 / r19060871;
        double r19060873 = 7.5690856942879e-321;
        bool r19060874 = r19060867 <= r19060873;
        double r19060875 = r19060864 * r19060870;
        double r19060876 = r19060875 / r19060866;
        double r19060877 = r19060874 ? r19060876 : r19060872;
        double r19060878 = r19060869 ? r19060872 : r19060877;
        return r19060878;
}

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.2
Target2.2
Herbie1.2
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (- x y) (- z y)) < -1.3538191510586175e-253 or 7.5690856942879e-321 < (/ (- x y) (- z y))

    1. Initial program 1.3

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied clear-num1.4

      \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t\]
    4. Using strategy rm
    5. Applied associate-*l/1.2

      \[\leadsto \color{blue}{\frac{1 \cdot t}{\frac{z - y}{x - y}}}\]
    6. Simplified1.2

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]

    if -1.3538191510586175e-253 < (/ (- x y) (- z y)) < 7.5690856942879e-321

    1. Initial program 18.9

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied associate-*l/0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.3538191510586175 \cdot 10^{-253}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 7.5690856942879 \cdot 10^{-321}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"

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

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