Average Error: 2.0 → 2.0
Time: 13.3s
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):\\ \;\;\;\;\sqrt{1} \cdot \frac{t}{\frac{z - y}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z - y} \cdot \left(\left(x - y\right) \cdot t\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):\\
\;\;\;\;\sqrt{1} \cdot \frac{t}{\frac{z - y}{x - y}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r630011 = x;
        double r630012 = y;
        double r630013 = r630011 - r630012;
        double r630014 = z;
        double r630015 = r630014 - r630012;
        double r630016 = r630013 / r630015;
        double r630017 = t;
        double r630018 = r630016 * r630017;
        return r630018;
}

double f(double x, double y, double z, double t) {
        double r630019 = y;
        double r630020 = -5.960013554415501e-174;
        bool r630021 = r630019 <= r630020;
        double r630022 = 8.404756557841443e-157;
        bool r630023 = r630019 <= r630022;
        double r630024 = !r630023;
        bool r630025 = r630021 || r630024;
        double r630026 = 1.0;
        double r630027 = sqrt(r630026);
        double r630028 = t;
        double r630029 = z;
        double r630030 = r630029 - r630019;
        double r630031 = x;
        double r630032 = r630031 - r630019;
        double r630033 = r630030 / r630032;
        double r630034 = r630028 / r630033;
        double r630035 = r630027 * r630034;
        double r630036 = r630026 / r630030;
        double r630037 = r630032 * r630028;
        double r630038 = r630036 * r630037;
        double r630039 = r630025 ? r630035 : r630038;
        return r630039;
}

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{z - y}{x - y}}} \cdot t\]
    8. Applied add-sqr-sqrt1.1

      \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{\frac{1}{1} \cdot \frac{z - y}{x - y}} \cdot t\]
    9. Applied times-frac1.1

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

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

      \[\leadsto \frac{\sqrt{1}}{\frac{1}{1}} \cdot \color{blue}{\frac{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 div-inv6.5

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

      \[\leadsto \color{blue}{\frac{\frac{1}{z - y}}{\frac{1}{x - y}}} \cdot t\]
    7. Using strategy rm
    8. Applied associate-/r/6.2

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

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

Reproduce

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