Average Error: 2.1 → 1.4
Time: 4.1s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq -5.0242384471013485 \cdot 10^{-142}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{elif}\;\frac{x - y}{z - y} \leq 8.09038377874979 \cdot 10^{-247}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \leq -5.0242384471013485 \cdot 10^{-142}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

\mathbf{elif}\;\frac{x - y}{z - y} \leq 8.09038377874979 \cdot 10^{-247}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - 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)) -5.0242384471013485e-142)
   (* (/ (- x y) (- z y)) t)
   (if (<= (/ (- x y) (- z y)) 8.09038377874979e-247)
     (/ (* (- x y) t) (- z y))
     (/ t (/ (- z y) (- x 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 tmp;
	if (((((double) (x - y)) / ((double) (z - y))) <= -5.0242384471013485e-142)) {
		tmp = ((double) ((((double) (x - y)) / ((double) (z - y))) * t));
	} else {
		double tmp_1;
		if (((((double) (x - y)) / ((double) (z - y))) <= 8.09038377874979e-247)) {
			tmp_1 = (((double) (((double) (x - y)) * t)) / ((double) (z - y)));
		} else {
			tmp_1 = (t / (((double) (z - y)) / ((double) (x - y))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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)) < -5.02423844710134845e-142

    1. Initial program Error: 2.7 bits

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

    if -5.02423844710134845e-142 < (/ (- x y) (- z y)) < 8.0903837787497904e-247

    1. Initial program Error: 6.9 bits

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

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

    if 8.0903837787497904e-247 < (/ (- x y) (- z y))

    1. Initial program Error: 0.9 bits

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied clear-numError: 0.9 bits

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

      \[\leadsto \color{blue}{\frac{1 \cdot t}{\frac{z - y}{x - y}}}\]
    6. SimplifiedError: 0.8 bits

      \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplificationError: 1.4 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq -5.0242384471013485 \cdot 10^{-142}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{elif}\;\frac{x - y}{z - y} \leq 8.09038377874979 \cdot 10^{-247}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \end{array}\]

Reproduce

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