Average Error: 2.1 → 1.6
Time: 4.8s
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:\\ \;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 5.14189203863818796 \cdot 10^{189}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \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:\\
\;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r446370 = x;
        double r446371 = y;
        double r446372 = r446370 - r446371;
        double r446373 = z;
        double r446374 = r446373 - r446371;
        double r446375 = r446372 / r446374;
        double r446376 = t;
        double r446377 = r446375 * r446376;
        return r446377;
}

double f(double x, double y, double z, double t) {
        double r446378 = x;
        double r446379 = y;
        double r446380 = r446378 - r446379;
        double r446381 = z;
        double r446382 = r446381 - r446379;
        double r446383 = r446380 / r446382;
        double r446384 = -1.1022940386055277e-35;
        bool r446385 = r446383 <= r446384;
        double r446386 = t;
        double r446387 = r446383 * r446386;
        double r446388 = 0.0;
        bool r446389 = r446383 <= r446388;
        double r446390 = r446380 * r446386;
        double r446391 = 1.0;
        double r446392 = r446391 / r446382;
        double r446393 = r446390 * r446392;
        double r446394 = 5.141892038638188e+189;
        bool r446395 = r446383 <= r446394;
        double r446396 = r446386 / r446382;
        double r446397 = r446380 * r446396;
        double r446398 = r446395 ? r446387 : r446397;
        double r446399 = r446389 ? r446393 : r446398;
        double r446400 = r446385 ? r446387 : r446399;
        return r446400;
}

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 div-inv5.6

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

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

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

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

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

    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 div-inv14.6

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

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

      \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{t}{z - y}}\]
  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:\\ \;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\\ \mathbf{elif}\;\frac{x - y}{z - y} \le 5.14189203863818796 \cdot 10^{189}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]

Reproduce

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