Average Error: 2.2 → 2.3
Time: 3.6s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -4.64445424201073893 \cdot 10^{-263}:\\ \;\;\;\;\frac{1}{\frac{\frac{z - y}{x - y}}{t}}\\ \mathbf{elif}\;y \le 1.13745415183481889 \cdot 10^{-162}:\\ \;\;\;\;\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}\;y \le -4.64445424201073893 \cdot 10^{-263}:\\
\;\;\;\;\frac{1}{\frac{\frac{z - y}{x - y}}{t}}\\

\mathbf{elif}\;y \le 1.13745415183481889 \cdot 10^{-162}:\\
\;\;\;\;\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 ((y <= -4.644454242010739e-263)) {
		VAR = ((double) (1.0 / ((double) (((double) (((double) (z - y)) / ((double) (x - y)))) / t))));
	} else {
		double VAR_1;
		if ((y <= 1.137454151834819e-162)) {
			VAR_1 = ((double) (((double) (((double) (x - y)) * t)) / ((double) (z - y))));
		} else {
			VAR_1 = ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
		}
		VAR = VAR_1;
	}
	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.2
Target2.2
Herbie2.3
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 3 regimes
  2. if y < -4.64445424201073893e-263

    1. Initial program 1.9

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

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

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

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]
    7. Using strategy rm
    8. Applied clear-num2.2

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

    if -4.64445424201073893e-263 < y < 1.13745415183481889e-162

    1. Initial program 6.0

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

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

    if 1.13745415183481889e-162 < y

    1. Initial program 1.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -4.64445424201073893 \cdot 10^{-263}:\\ \;\;\;\;\frac{1}{\frac{\frac{z - y}{x - y}}{t}}\\ \mathbf{elif}\;y \le 1.13745415183481889 \cdot 10^{-162}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]

Reproduce

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