Average Error: 2.1 → 1.4
Time: 3.7s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq -2.2475450344196267 \cdot 10^{+174}:\\ \;\;\;\;\frac{x - y}{\frac{z - y}{t}}\\ \mathbf{elif}\;\frac{x - y}{z - y} \leq 5.268035432138612 \cdot 10^{+122}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \leq -2.2475450344196267 \cdot 10^{+174}:\\
\;\;\;\;\frac{x - y}{\frac{z - y}{t}}\\

\mathbf{elif}\;\frac{x - y}{z - y} \leq 5.268035432138612 \cdot 10^{+122}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

\mathbf{else}:\\
\;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\\

\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ (- x y) (- z y)) -2.2475450344196267e+174)
   (/ (- x y) (/ (- z y) t))
   (if (<= (/ (- x y) (- z y)) 5.268035432138612e+122)
     (* (/ (- x y) (- z y)) t)
     (* (* (- x y) t) (/ 1.0 (- z y))))))
double code(double x, double y, double z, double t) {
	return ((double) ((((double) (x - y)) / ((double) (z - y))) * t));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((((double) (x - y)) / ((double) (z - y))) <= -2.2475450344196267e+174)) {
		VAR = (((double) (x - y)) / (((double) (z - y)) / t));
	} else {
		double VAR_1;
		if (((((double) (x - y)) / ((double) (z - y))) <= 5.268035432138612e+122)) {
			VAR_1 = ((double) ((((double) (x - y)) / ((double) (z - y))) * t));
		} else {
			VAR_1 = ((double) (((double) (((double) (x - y)) * t)) * (1.0 / ((double) (z - y)))));
		}
		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.1
Target2.1
Herbie1.4
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (- x y) (- z y)) < -2.2475450344196267e174

    1. Initial program 14.5

      \[\frac{x - y}{z - y} \cdot t\]
    2. Simplified1.7

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}}\]
    3. Using strategy rm
    4. Applied clear-num1.8

      \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{1}{\frac{z - y}{t}}}\]
    5. Using strategy rm
    6. Applied un-div-inv1.7

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

    if -2.2475450344196267e174 < (/ (- x y) (- z y)) < 5.2680354321386121e122

    1. Initial program 1.1

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

    if 5.2680354321386121e122 < (/ (- x y) (- z y))

    1. Initial program 9.7

      \[\frac{x - y}{z - y} \cdot t\]
    2. Simplified3.0

      \[\leadsto \color{blue}{\left(x - y\right) \cdot \frac{t}{z - y}}\]
    3. Using strategy rm
    4. Applied div-inv3.1

      \[\leadsto \left(x - y\right) \cdot \color{blue}{\left(t \cdot \frac{1}{z - y}\right)}\]
    5. Applied associate-*r*6.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq -2.2475450344196267 \cdot 10^{+174}:\\ \;\;\;\;\frac{x - y}{\frac{z - y}{t}}\\ \mathbf{elif}\;\frac{x - y}{z - y} \leq 5.268035432138612 \cdot 10^{+122}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - y}\\ \end{array}\]

Reproduce

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