Average Error: 2.3 → 2.3
Time: 10.9s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le 5.259516187712176019874768300614952215263 \cdot 10^{-223} \lor \neg \left(y \le 1.755596810276153497846698007661699115869 \cdot 10^{-97}\right):\\ \;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le 5.259516187712176019874768300614952215263 \cdot 10^{-223} \lor \neg \left(y \le 1.755596810276153497846698007661699115869 \cdot 10^{-97}\right):\\
\;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r385590 = x;
        double r385591 = y;
        double r385592 = r385590 - r385591;
        double r385593 = z;
        double r385594 = r385593 - r385591;
        double r385595 = r385592 / r385594;
        double r385596 = t;
        double r385597 = r385595 * r385596;
        return r385597;
}

double f(double x, double y, double z, double t) {
        double r385598 = y;
        double r385599 = 5.259516187712176e-223;
        bool r385600 = r385598 <= r385599;
        double r385601 = 1.7555968102761535e-97;
        bool r385602 = r385598 <= r385601;
        double r385603 = !r385602;
        bool r385604 = r385600 || r385603;
        double r385605 = t;
        double r385606 = x;
        double r385607 = z;
        double r385608 = r385607 - r385598;
        double r385609 = r385606 / r385608;
        double r385610 = r385598 / r385608;
        double r385611 = r385609 - r385610;
        double r385612 = r385605 * r385611;
        double r385613 = r385606 - r385598;
        double r385614 = r385605 * r385613;
        double r385615 = r385614 / r385608;
        double r385616 = r385604 ? r385612 : r385615;
        return r385616;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < 5.259516187712176e-223 or 1.7555968102761535e-97 < y

    1. Initial program 2.0

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

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

    if 5.259516187712176e-223 < y < 1.7555968102761535e-97

    1. Initial program 4.8

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied associate-*l/4.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 5.259516187712176019874768300614952215263 \cdot 10^{-223} \lor \neg \left(y \le 1.755596810276153497846698007661699115869 \cdot 10^{-97}\right):\\ \;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \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))