Average Error: 2.0 → 2.0
Time: 7.1s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.298520785946563301647513642870177462015 \cdot 10^{-104} \lor \neg \left(y \le 3.224382231478152736415924797172890526842 \cdot 10^{-189}\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}\;y \le -2.298520785946563301647513642870177462015 \cdot 10^{-104} \lor \neg \left(y \le 3.224382231478152736415924797172890526842 \cdot 10^{-189}\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 r458071 = x;
        double r458072 = y;
        double r458073 = r458071 - r458072;
        double r458074 = z;
        double r458075 = r458074 - r458072;
        double r458076 = r458073 / r458075;
        double r458077 = t;
        double r458078 = r458076 * r458077;
        return r458078;
}

double f(double x, double y, double z, double t) {
        double r458079 = y;
        double r458080 = -2.2985207859465633e-104;
        bool r458081 = r458079 <= r458080;
        double r458082 = 3.2243822314781527e-189;
        bool r458083 = r458079 <= r458082;
        double r458084 = !r458083;
        bool r458085 = r458081 || r458084;
        double r458086 = x;
        double r458087 = r458086 - r458079;
        double r458088 = z;
        double r458089 = r458088 - r458079;
        double r458090 = r458087 / r458089;
        double r458091 = t;
        double r458092 = r458090 * r458091;
        double r458093 = r458087 * r458091;
        double r458094 = r458093 / r458089;
        double r458095 = r458085 ? r458092 : r458094;
        return r458095;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -2.2985207859465633e-104 or 3.2243822314781527e-189 < y

    1. Initial program 0.9

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

    if -2.2985207859465633e-104 < y < 3.2243822314781527e-189

    1. Initial program 5.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.298520785946563301647513642870177462015 \cdot 10^{-104} \lor \neg \left(y \le 3.224382231478152736415924797172890526842 \cdot 10^{-189}\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 2019354 
(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))