Average Error: 2.1 → 2.1
Time: 13.9s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.731528862364635971334975863962139691772 \cdot 10^{-192} \lor \neg \left(y \le 1.029600783531290838385682434122580584308 \cdot 10^{-97}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -2.731528862364635971334975863962139691772 \cdot 10^{-192} \lor \neg \left(y \le 1.029600783531290838385682434122580584308 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r716090 = x;
        double r716091 = y;
        double r716092 = r716090 - r716091;
        double r716093 = z;
        double r716094 = r716093 - r716091;
        double r716095 = r716092 / r716094;
        double r716096 = t;
        double r716097 = r716095 * r716096;
        return r716097;
}

double f(double x, double y, double z, double t) {
        double r716098 = y;
        double r716099 = -2.731528862364636e-192;
        bool r716100 = r716098 <= r716099;
        double r716101 = 1.0296007835312908e-97;
        bool r716102 = r716098 <= r716101;
        double r716103 = !r716102;
        bool r716104 = r716100 || r716103;
        double r716105 = x;
        double r716106 = r716105 - r716098;
        double r716107 = z;
        double r716108 = r716107 - r716098;
        double r716109 = r716106 / r716108;
        double r716110 = t;
        double r716111 = r716109 * r716110;
        double r716112 = r716106 * r716110;
        double r716113 = r716112 / r716108;
        double r716114 = r716104 ? r716111 : r716113;
        return r716114;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -2.731528862364636e-192 or 1.0296007835312908e-97 < y

    1. Initial program 0.9

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

      \[\leadsto \color{blue}{\left(\left(x - y\right) \cdot \frac{1}{z - y}\right)} \cdot t\]
    4. Using strategy rm
    5. Applied pow11.0

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

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

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

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

    if -2.731528862364636e-192 < y < 1.0296007835312908e-97

    1. Initial program 5.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.731528862364635971334975863962139691772 \cdot 10^{-192} \lor \neg \left(y \le 1.029600783531290838385682434122580584308 \cdot 10^{-97}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \end{array}\]

Reproduce

herbie shell --seed 2019350 +o rules:numerics
(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))