Average Error: 2.0 → 2.0
Time: 14.5s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -5.96001355441550078 \cdot 10^{-174} \lor \neg \left(y \le 8.4047565578414434 \cdot 10^{-157}\right):\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z - y} \cdot \left(t \cdot \left(x - y\right)\right)\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -5.96001355441550078 \cdot 10^{-174} \lor \neg \left(y \le 8.4047565578414434 \cdot 10^{-157}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r567625 = x;
        double r567626 = y;
        double r567627 = r567625 - r567626;
        double r567628 = z;
        double r567629 = r567628 - r567626;
        double r567630 = r567627 / r567629;
        double r567631 = t;
        double r567632 = r567630 * r567631;
        return r567632;
}

double f(double x, double y, double z, double t) {
        double r567633 = y;
        double r567634 = -5.960013554415501e-174;
        bool r567635 = r567633 <= r567634;
        double r567636 = 8.404756557841443e-157;
        bool r567637 = r567633 <= r567636;
        double r567638 = !r567637;
        bool r567639 = r567635 || r567638;
        double r567640 = t;
        double r567641 = z;
        double r567642 = r567641 - r567633;
        double r567643 = x;
        double r567644 = r567643 - r567633;
        double r567645 = r567642 / r567644;
        double r567646 = r567640 / r567645;
        double r567647 = 1.0;
        double r567648 = r567647 / r567642;
        double r567649 = r567640 * r567644;
        double r567650 = r567648 * r567649;
        double r567651 = r567639 ? r567646 : r567650;
        return r567651;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -5.960013554415501e-174 or 8.404756557841443e-157 < y

    1. Initial program 1.0

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied clear-num1.1

      \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t\]
    4. Using strategy rm
    5. Applied associate-*l/1.0

      \[\leadsto \color{blue}{\frac{1 \cdot t}{\frac{z - y}{x - y}}}\]
    6. Simplified1.0

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]

    if -5.960013554415501e-174 < y < 8.404756557841443e-157

    1. Initial program 6.1

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied clear-num6.5

      \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t\]
    4. Using strategy rm
    5. Applied associate-*l/6.1

      \[\leadsto \color{blue}{\frac{1 \cdot t}{\frac{z - y}{x - y}}}\]
    6. Simplified6.1

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]
    7. Using strategy rm
    8. Applied div-inv6.2

      \[\leadsto \frac{t}{\color{blue}{\left(z - y\right) \cdot \frac{1}{x - y}}}\]
    9. Applied *-un-lft-identity6.2

      \[\leadsto \frac{\color{blue}{1 \cdot t}}{\left(z - y\right) \cdot \frac{1}{x - y}}\]
    10. Applied times-frac6.0

      \[\leadsto \color{blue}{\frac{1}{z - y} \cdot \frac{t}{\frac{1}{x - y}}}\]
    11. Simplified5.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -5.96001355441550078 \cdot 10^{-174} \lor \neg \left(y \le 8.4047565578414434 \cdot 10^{-157}\right):\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z - y} \cdot \left(t \cdot \left(x - y\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020043 +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))