Average Error: 2.5 → 2.4
Time: 10.9s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.576071319792023313107117462362743129483 \cdot 10^{-193} \lor \neg \left(y \le 2.769657224942360588254267381101232254796 \cdot 10^{-67}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -1.576071319792023313107117462362743129483 \cdot 10^{-193} \lor \neg \left(y \le 2.769657224942360588254267381101232254796 \cdot 10^{-67}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r334451 = x;
        double r334452 = y;
        double r334453 = r334451 - r334452;
        double r334454 = z;
        double r334455 = r334454 - r334452;
        double r334456 = r334453 / r334455;
        double r334457 = t;
        double r334458 = r334456 * r334457;
        return r334458;
}

double f(double x, double y, double z, double t) {
        double r334459 = y;
        double r334460 = -1.5760713197920233e-193;
        bool r334461 = r334459 <= r334460;
        double r334462 = 2.7696572249423606e-67;
        bool r334463 = r334459 <= r334462;
        double r334464 = !r334463;
        bool r334465 = r334461 || r334464;
        double r334466 = x;
        double r334467 = z;
        double r334468 = r334467 - r334459;
        double r334469 = r334466 / r334468;
        double r334470 = r334459 / r334468;
        double r334471 = r334469 - r334470;
        double r334472 = t;
        double r334473 = r334471 * r334472;
        double r334474 = r334466 - r334459;
        double r334475 = r334472 / r334468;
        double r334476 = r334474 * r334475;
        double r334477 = r334465 ? r334473 : r334476;
        return r334477;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -1.5760713197920233e-193 or 2.7696572249423606e-67 < y

    1. Initial program 1.0

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

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

    if -1.5760713197920233e-193 < y < 2.7696572249423606e-67

    1. Initial program 6.5

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.576071319792023313107117462362743129483 \cdot 10^{-193} \lor \neg \left(y \le 2.769657224942360588254267381101232254796 \cdot 10^{-67}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]

Reproduce

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