Average Error: 2.1 → 1.1
Time: 10.8s
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 r24087129 = x;
        double r24087130 = y;
        double r24087131 = r24087129 - r24087130;
        double r24087132 = z;
        double r24087133 = r24087132 - r24087130;
        double r24087134 = r24087131 / r24087133;
        double r24087135 = t;
        double r24087136 = r24087134 * r24087135;
        return r24087136;
}

double f(double x, double y, double z, double t) {
        double r24087137 = x;
        double r24087138 = y;
        double r24087139 = r24087137 - r24087138;
        double r24087140 = z;
        double r24087141 = r24087140 - r24087138;
        double r24087142 = r24087139 / r24087141;
        double r24087143 = -1.3538191510586175e-253;
        bool r24087144 = r24087142 <= r24087143;
        double r24087145 = t;
        double r24087146 = r24087141 / r24087139;
        double r24087147 = r24087145 / r24087146;
        double r24087148 = 7.5690856942879e-321;
        bool r24087149 = r24087142 <= r24087148;
        double r24087150 = r24087139 * r24087145;
        double r24087151 = r24087150 / r24087141;
        double r24087152 = r24087149 ? r24087151 : r24087147;
        double r24087153 = r24087144 ? r24087147 : r24087152;
        return r24087153;
}

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.2
Herbie1.1
\[\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.2

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

      \[\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 clear-num19.8

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

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

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]
    7. Using strategy rm
    8. Applied associate-/r/0.3

      \[\leadsto \color{blue}{\frac{t}{z - y} \cdot \left(x - y\right)}\]
    9. Using strategy rm
    10. Applied associate-*l/0.1

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

    \[\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))