Average Error: 1.9 → 1.9
Time: 3.6s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le 3.2554078815889216 \cdot 10^{-281} \lor \neg \left(t \le 2.67299805340548718 \cdot 10^{-148}\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}\;t \le 3.2554078815889216 \cdot 10^{-281} \lor \neg \left(t \le 2.67299805340548718 \cdot 10^{-148}\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 r476619 = x;
        double r476620 = y;
        double r476621 = r476619 - r476620;
        double r476622 = z;
        double r476623 = r476622 - r476620;
        double r476624 = r476621 / r476623;
        double r476625 = t;
        double r476626 = r476624 * r476625;
        return r476626;
}

double f(double x, double y, double z, double t) {
        double r476627 = t;
        double r476628 = 3.2554078815889216e-281;
        bool r476629 = r476627 <= r476628;
        double r476630 = 2.6729980534054872e-148;
        bool r476631 = r476627 <= r476630;
        double r476632 = !r476631;
        bool r476633 = r476629 || r476632;
        double r476634 = x;
        double r476635 = y;
        double r476636 = r476634 - r476635;
        double r476637 = z;
        double r476638 = r476637 - r476635;
        double r476639 = r476636 / r476638;
        double r476640 = r476639 * r476627;
        double r476641 = r476636 * r476627;
        double r476642 = r476641 / r476638;
        double r476643 = r476633 ? r476640 : r476642;
        return r476643;
}

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

Original1.9
Target2.0
Herbie1.9
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if t < 3.2554078815889216e-281 or 2.6729980534054872e-148 < t

    1. Initial program 1.9

      \[\frac{x - y}{z - y} \cdot t\]

    if 3.2554078815889216e-281 < t < 2.6729980534054872e-148

    1. Initial program 1.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le 3.2554078815889216 \cdot 10^{-281} \lor \neg \left(t \le 2.67299805340548718 \cdot 10^{-148}\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 2020018 
(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))