Average Error: 2.3 → 2.3
Time: 10.3s
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 r269945 = x;
        double r269946 = y;
        double r269947 = r269945 - r269946;
        double r269948 = z;
        double r269949 = r269948 - r269946;
        double r269950 = r269947 / r269949;
        double r269951 = t;
        double r269952 = r269950 * r269951;
        return r269952;
}

double f(double x, double y, double z, double t) {
        double r269953 = y;
        double r269954 = 5.259516187712176e-223;
        bool r269955 = r269953 <= r269954;
        double r269956 = 1.7555968102761535e-97;
        bool r269957 = r269953 <= r269956;
        double r269958 = !r269957;
        bool r269959 = r269955 || r269958;
        double r269960 = t;
        double r269961 = x;
        double r269962 = z;
        double r269963 = r269962 - r269953;
        double r269964 = r269961 / r269963;
        double r269965 = r269953 / r269963;
        double r269966 = r269964 - r269965;
        double r269967 = r269960 * r269966;
        double r269968 = r269961 - r269953;
        double r269969 = r269960 * r269968;
        double r269970 = r269969 / r269963;
        double r269971 = r269959 ? r269967 : r269970;
        return r269971;
}

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 pow14.8

      \[\leadsto \frac{x - y}{z - y} \cdot \color{blue}{{t}^{1}}\]
    4. Applied pow14.8

      \[\leadsto \color{blue}{{\left(\frac{x - y}{z - y}\right)}^{1}} \cdot {t}^{1}\]
    5. Applied pow-prod-down4.8

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

      \[\leadsto {\color{blue}{\left(\frac{\left(x - y\right) \cdot t}{z - y}\right)}}^{1}\]
  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 +o rules:numerics
(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))