Average Error: 2.1 → 0.9
Time: 3.2s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.7918506214892867 \cdot 10^{299} \lor \neg \left(\frac{x - y}{z - y} \le -1.1471559015900161 \cdot 10^{-143} \lor \neg \left(\frac{x - y}{z - y} \le 1.54577676 \cdot 10^{-317}\right)\right):\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \le -1.7918506214892867 \cdot 10^{299} \lor \neg \left(\frac{x - y}{z - y} \le -1.1471559015900161 \cdot 10^{-143} \lor \neg \left(\frac{x - y}{z - y} \le 1.54577676 \cdot 10^{-317}\right)\right):\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r484239 = x;
        double r484240 = y;
        double r484241 = r484239 - r484240;
        double r484242 = z;
        double r484243 = r484242 - r484240;
        double r484244 = r484241 / r484243;
        double r484245 = t;
        double r484246 = r484244 * r484245;
        return r484246;
}

double f(double x, double y, double z, double t) {
        double r484247 = x;
        double r484248 = y;
        double r484249 = r484247 - r484248;
        double r484250 = z;
        double r484251 = r484250 - r484248;
        double r484252 = r484249 / r484251;
        double r484253 = -1.7918506214892867e+299;
        bool r484254 = r484252 <= r484253;
        double r484255 = -1.147155901590016e-143;
        bool r484256 = r484252 <= r484255;
        double r484257 = 1.5457767632901e-317;
        bool r484258 = r484252 <= r484257;
        double r484259 = !r484258;
        bool r484260 = r484256 || r484259;
        double r484261 = !r484260;
        bool r484262 = r484254 || r484261;
        double r484263 = t;
        double r484264 = r484249 * r484263;
        double r484265 = r484264 / r484251;
        double r484266 = r484252 * r484263;
        double r484267 = r484262 ? r484265 : r484266;
        return r484267;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (/ (- x y) (- z y)) < -1.7918506214892867e+299 or -1.147155901590016e-143 < (/ (- x y) (- z y)) < 1.5457767632901e-317

    1. Initial program 12.6

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

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

    if -1.7918506214892867e+299 < (/ (- x y) (- z y)) < -1.147155901590016e-143 or 1.5457767632901e-317 < (/ (- x y) (- z y))

    1. Initial program 0.8

      \[\frac{x - y}{z - y} \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.7918506214892867 \cdot 10^{299} \lor \neg \left(\frac{x - y}{z - y} \le -1.1471559015900161 \cdot 10^{-143} \lor \neg \left(\frac{x - y}{z - y} \le 1.54577676 \cdot 10^{-317}\right)\right):\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2020064 +o rules:numerics
(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))