Average Error: 2.1 → 2.2
Time: 3.7s
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 r470274 = x;
        double r470275 = y;
        double r470276 = r470274 - r470275;
        double r470277 = z;
        double r470278 = r470277 - r470275;
        double r470279 = r470276 / r470278;
        double r470280 = t;
        double r470281 = r470279 * r470280;
        return r470281;
}

double f(double x, double y, double z, double t) {
        double r470282 = y;
        double r470283 = -4.0376800463870345e-38;
        bool r470284 = r470282 <= r470283;
        double r470285 = 8.76076775974317e-63;
        bool r470286 = r470282 <= r470285;
        double r470287 = !r470286;
        bool r470288 = r470284 || r470287;
        double r470289 = x;
        double r470290 = z;
        double r470291 = r470290 - r470282;
        double r470292 = r470289 / r470291;
        double r470293 = r470282 / r470291;
        double r470294 = r470292 - r470293;
        double r470295 = t;
        double r470296 = r470294 * r470295;
        double r470297 = r470289 - r470282;
        double r470298 = r470295 / r470291;
        double r470299 = r470297 * r470298;
        double r470300 = r470288 ? r470296 : r470299;
        return r470300;
}

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