Average Error: 2.3 → 1.0
Time: 15.6s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t = -\infty:\\ \;\;\;\;\frac{1}{z - y} \cdot \left(t \cdot \left(x - y\right)\right)\\ \mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le -2.640233754742455 \cdot 10^{-299}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le 0.0:\\ \;\;\;\;\frac{1}{z - y} \cdot \left(t \cdot \left(x - y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z}{x - y} - \frac{y}{x - y}}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \cdot t = -\infty:\\
\;\;\;\;\frac{1}{z - y} \cdot \left(t \cdot \left(x - y\right)\right)\\

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r21267123 = x;
        double r21267124 = y;
        double r21267125 = r21267123 - r21267124;
        double r21267126 = z;
        double r21267127 = r21267126 - r21267124;
        double r21267128 = r21267125 / r21267127;
        double r21267129 = t;
        double r21267130 = r21267128 * r21267129;
        return r21267130;
}

double f(double x, double y, double z, double t) {
        double r21267131 = x;
        double r21267132 = y;
        double r21267133 = r21267131 - r21267132;
        double r21267134 = z;
        double r21267135 = r21267134 - r21267132;
        double r21267136 = r21267133 / r21267135;
        double r21267137 = t;
        double r21267138 = r21267136 * r21267137;
        double r21267139 = -inf.0;
        bool r21267140 = r21267138 <= r21267139;
        double r21267141 = 1.0;
        double r21267142 = r21267141 / r21267135;
        double r21267143 = r21267137 * r21267133;
        double r21267144 = r21267142 * r21267143;
        double r21267145 = -2.640233754742455e-299;
        bool r21267146 = r21267138 <= r21267145;
        double r21267147 = 0.0;
        bool r21267148 = r21267138 <= r21267147;
        double r21267149 = r21267134 / r21267133;
        double r21267150 = r21267132 / r21267133;
        double r21267151 = r21267149 - r21267150;
        double r21267152 = r21267137 / r21267151;
        double r21267153 = r21267148 ? r21267144 : r21267152;
        double r21267154 = r21267146 ? r21267138 : r21267153;
        double r21267155 = r21267140 ? r21267144 : r21267154;
        return r21267155;
}

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

Derivation

  1. Split input into 3 regimes
  2. if (* (/ (- x y) (- z y)) t) < -inf.0 or -2.640233754742455e-299 < (* (/ (- x y) (- z y)) t) < 0.0

    1. Initial program 12.1

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

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

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

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]
    7. Using strategy rm
    8. Applied div-inv11.7

      \[\leadsto \frac{t}{\color{blue}{\left(z - y\right) \cdot \frac{1}{x - y}}}\]
    9. Applied *-un-lft-identity11.7

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

      \[\leadsto \color{blue}{\frac{1}{z - y} \cdot \frac{t}{\frac{1}{x - y}}}\]
    11. Simplified0.5

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

    if -inf.0 < (* (/ (- x y) (- z y)) t) < -2.640233754742455e-299

    1. Initial program 0.3

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

    if 0.0 < (* (/ (- x y) (- z y)) t)

    1. Initial program 1.8

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

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

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

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]
    7. Using strategy rm
    8. Applied div-sub1.8

      \[\leadsto \frac{t}{\color{blue}{\frac{z}{x - y} - \frac{y}{x - y}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.0

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

Reproduce

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