Average Error: 2.4 → 1.1
Time: 7.9s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t = -inf.0 \lor \neg \left(\frac{x - y}{z - y} \cdot t \le -2.2967359754016671 \cdot 10^{-274} \lor \neg \left(\frac{x - y}{z - y} \cdot t \le 9.2907999515337591 \cdot 10^{-276}\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} \cdot t = -inf.0 \lor \neg \left(\frac{x - y}{z - y} \cdot t \le -2.2967359754016671 \cdot 10^{-274} \lor \neg \left(\frac{x - y}{z - y} \cdot t \le 9.2907999515337591 \cdot 10^{-276}\right)\right):\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t)) <= -inf.0) || !((((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t)) <= -2.296735975401667e-274) || !(((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t)) <= 9.290799951533759e-276)))) {
		VAR = ((double) (((double) (((double) (x - y)) * t)) / ((double) (z - y))));
	} else {
		VAR = ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
	}
	return VAR;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (* (/ (- x y) (- z y)) t) < -inf.0 or -2.296735975401667e-274 < (* (/ (- x y) (- z y)) t) < 9.290799951533759e-276

    1. Initial program 9.8

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

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

    if -inf.0 < (* (/ (- x y) (- z y)) t) < -2.296735975401667e-274 or 9.290799951533759e-276 < (* (/ (- x y) (- z y)) t)

    1. Initial program 1.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t = -inf.0 \lor \neg \left(\frac{x - y}{z - y} \cdot t \le -2.2967359754016671 \cdot 10^{-274} \lor \neg \left(\frac{x - y}{z - y} \cdot t \le 9.2907999515337591 \cdot 10^{-276}\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 2020148 
(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))