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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r21234303 = x;
        double r21234304 = y;
        double r21234305 = r21234303 - r21234304;
        double r21234306 = z;
        double r21234307 = r21234306 - r21234304;
        double r21234308 = r21234305 / r21234307;
        double r21234309 = t;
        double r21234310 = r21234308 * r21234309;
        return r21234310;
}

double f(double x, double y, double z, double t) {
        double r21234311 = x;
        double r21234312 = y;
        double r21234313 = r21234311 - r21234312;
        double r21234314 = z;
        double r21234315 = r21234314 - r21234312;
        double r21234316 = r21234313 / r21234315;
        double r21234317 = t;
        double r21234318 = r21234316 * r21234317;
        double r21234319 = -inf.0;
        bool r21234320 = r21234318 <= r21234319;
        double r21234321 = r21234317 / r21234315;
        double r21234322 = r21234313 * r21234321;
        double r21234323 = -2.892583399114e-313;
        bool r21234324 = r21234318 <= r21234323;
        double r21234325 = 0.0;
        bool r21234326 = r21234318 <= r21234325;
        double r21234327 = r21234317 * r21234313;
        double r21234328 = r21234327 / r21234315;
        double r21234329 = r21234326 ? r21234328 : r21234318;
        double r21234330 = r21234324 ? r21234318 : r21234329;
        double r21234331 = r21234320 ? r21234322 : r21234330;
        return r21234331;
}

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

Derivation

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

    1. Initial program 64.0

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

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

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

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

    if -inf.0 < (* (/ (- x y) (- z y)) t) < -2.892583399114e-313 or 0.0 < (* (/ (- x y) (- z y)) t)

    1. Initial program 0.9

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

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

    1. Initial program 8.7

      \[\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 3 regimes into one program.
  4. Final simplification0.8

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

Reproduce

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