Average Error: 2.1 → 2.2
Time: 3.7s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \leq -2.703203109859195 \cdot 10^{-22} \lor \neg \left(y \leq 3.1725025516793346 \cdot 10^{-171}\right):\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \leq -2.703203109859195 \cdot 10^{-22} \lor \neg \left(y \leq 3.1725025516793346 \cdot 10^{-171}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\

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

\end{array}
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 (((y <= -2.703203109859195e-22) || !(y <= 3.1725025516793346e-171))) {
		VAR = (t / (((double) (z - y)) / ((double) (x - y))));
	} else {
		VAR = ((double) (((double) (x - y)) * (t / ((double) (z - y)))));
	}
	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
Herbie2.2
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -2.70320310985919488e-22 or 3.1725025516793346e-171 < y

    1. Initial program Error: 0.9 bits

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

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

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

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

    if -2.70320310985919488e-22 < y < 3.1725025516793346e-171

    1. Initial program Error: 4.8 bits

      \[\frac{x - y}{z - y} \cdot t\]
    2. SimplifiedError: 5.1 bits

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.703203109859195 \cdot 10^{-22} \lor \neg \left(y \leq 3.1725025516793346 \cdot 10^{-171}\right):\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]

Reproduce

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