Average Error: 2.2 → 2.1
Time: 16.4s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.8586745194188488 \cdot 10^{-190}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{elif}\;y \le 6.790926987711054 \cdot 10^{-54}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -1.8586745194188488 \cdot 10^{-190}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\

\mathbf{elif}\;y \le 6.790926987711054 \cdot 10^{-54}:\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r23968996 = x;
        double r23968997 = y;
        double r23968998 = r23968996 - r23968997;
        double r23968999 = z;
        double r23969000 = r23968999 - r23968997;
        double r23969001 = r23968998 / r23969000;
        double r23969002 = t;
        double r23969003 = r23969001 * r23969002;
        return r23969003;
}

double f(double x, double y, double z, double t) {
        double r23969004 = y;
        double r23969005 = -1.8586745194188488e-190;
        bool r23969006 = r23969004 <= r23969005;
        double r23969007 = t;
        double r23969008 = z;
        double r23969009 = r23969008 - r23969004;
        double r23969010 = x;
        double r23969011 = r23969010 - r23969004;
        double r23969012 = r23969009 / r23969011;
        double r23969013 = r23969007 / r23969012;
        double r23969014 = 6.790926987711054e-54;
        bool r23969015 = r23969004 <= r23969014;
        double r23969016 = r23969007 * r23969011;
        double r23969017 = r23969016 / r23969009;
        double r23969018 = r23969015 ? r23969017 : r23969013;
        double r23969019 = r23969006 ? r23969013 : r23969018;
        return r23969019;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -1.8586745194188488e-190 or 6.790926987711054e-54 < y

    1. Initial program 0.8

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

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

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

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

    if -1.8586745194188488e-190 < y < 6.790926987711054e-54

    1. Initial program 5.6

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity5.6

      \[\leadsto \frac{x - y}{\color{blue}{1 \cdot \left(z - y\right)}} \cdot t\]
    4. Applied add-cube-cbrt6.5

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1} \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)}\]
    7. Using strategy rm
    8. Applied associate-*l/5.5

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

      \[\leadsto \color{blue}{\frac{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \left(\sqrt[3]{x - y} \cdot t\right)}{1 \cdot \left(z - y\right)}}\]
    10. Simplified5.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.8586745194188488 \cdot 10^{-190}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{elif}\;y \le 6.790926987711054 \cdot 10^{-54}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019163 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"

  :herbie-target
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))