Average Error: 2.3 → 2.4
Time: 3.5s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -5.1084132183414814 \cdot 10^{-215} \lor \neg \left(y \le 3.731124293974029 \cdot 10^{-13}\right):\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -5.1084132183414814 \cdot 10^{-215} \lor \neg \left(y \le 3.731124293974029 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\

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

\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 <= -5.108413218341481e-215) || !(y <= 3.731124293974029e-13))) {
		VAR = ((double) (t / ((double) (((double) (z - y)) / ((double) (x - y))))));
	} else {
		VAR = ((double) (((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.3
Target2.4
Herbie2.4
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -5.108413218341481e-215 or 3.731124293974029e-13 < y

    1. Initial program 1.0

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

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

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

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

    if -5.108413218341481e-215 < y < 3.731124293974029e-13

    1. Initial program 5.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -5.1084132183414814 \cdot 10^{-215} \lor \neg \left(y \le 3.731124293974029 \cdot 10^{-13}\right):\\ \;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \end{array}\]

Reproduce

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