Average Error: 2.1 → 2.2
Time: 13.4s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -4.03768004638703446681329529893279855834 \cdot 10^{-38} \lor \neg \left(y \le 8.760767759743170375553632164025646263167 \cdot 10^{-63}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \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}\;y \le -4.03768004638703446681329529893279855834 \cdot 10^{-38} \lor \neg \left(y \le 8.760767759743170375553632164025646263167 \cdot 10^{-63}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \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 r295327 = x;
        double r295328 = y;
        double r295329 = r295327 - r295328;
        double r295330 = z;
        double r295331 = r295330 - r295328;
        double r295332 = r295329 / r295331;
        double r295333 = t;
        double r295334 = r295332 * r295333;
        return r295334;
}

double f(double x, double y, double z, double t) {
        double r295335 = y;
        double r295336 = -4.0376800463870345e-38;
        bool r295337 = r295335 <= r295336;
        double r295338 = 8.76076775974317e-63;
        bool r295339 = r295335 <= r295338;
        double r295340 = !r295339;
        bool r295341 = r295337 || r295340;
        double r295342 = x;
        double r295343 = z;
        double r295344 = r295343 - r295335;
        double r295345 = r295342 / r295344;
        double r295346 = r295335 / r295344;
        double r295347 = r295345 - r295346;
        double r295348 = t;
        double r295349 = r295347 * r295348;
        double r295350 = r295342 - r295335;
        double r295351 = r295348 / r295344;
        double r295352 = r295350 * r295351;
        double r295353 = r295341 ? r295349 : r295352;
        return r295353;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -4.0376800463870345e-38 or 8.76076775974317e-63 < y

    1. Initial program 0.2

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

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

    if -4.0376800463870345e-38 < y < 8.76076775974317e-63

    1. Initial program 5.1

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -4.03768004638703446681329529893279855834 \cdot 10^{-38} \lor \neg \left(y \le 8.760767759743170375553632164025646263167 \cdot 10^{-63}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]

Reproduce

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