Average Error: 2.1 → 2.1
Time: 11.1s
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{t \cdot \left(x - y\right)}{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{t \cdot \left(x - y\right)}{z - y}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r378810 = x;
        double r378811 = y;
        double r378812 = r378810 - r378811;
        double r378813 = z;
        double r378814 = r378813 - r378811;
        double r378815 = r378812 / r378814;
        double r378816 = t;
        double r378817 = r378815 * r378816;
        return r378817;
}

double f(double x, double y, double z, double t) {
        double r378818 = y;
        double r378819 = -2.731528862364636e-192;
        bool r378820 = r378818 <= r378819;
        double r378821 = 1.0296007835312908e-97;
        bool r378822 = r378818 <= r378821;
        double r378823 = !r378822;
        bool r378824 = r378820 || r378823;
        double r378825 = x;
        double r378826 = r378825 - r378818;
        double r378827 = z;
        double r378828 = r378827 - r378818;
        double r378829 = r378826 / r378828;
        double r378830 = t;
        double r378831 = r378829 * r378830;
        double r378832 = r378830 * r378826;
        double r378833 = r378832 / r378828;
        double r378834 = r378824 ? r378831 : r378833;
        return r378834;
}

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 *-un-lft-identity1.0

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

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

      \[\leadsto \left(1 \cdot \color{blue}{\frac{x - y}{z - y}}\right) \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 div-inv6.0

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

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

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

      \[\leadsto \left(1 \cdot \color{blue}{\frac{x - y}{z - y}}\right) \cdot t\]
    8. Using strategy rm
    9. Applied associate-*r/5.9

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(x - y\right)}}{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{t \cdot \left(x - y\right)}{z - y}\\ \end{array}\]

Reproduce

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