Average Error: 2.3 → 2.4
Time: 4.4s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \leq -2.0915467853000205 \cdot 10^{-42} \lor \neg \left(y \leq 1.9469965754910335 \cdot 10^{-177}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \leq -2.0915467853000205 \cdot 10^{-42} \lor \neg \left(y \leq 1.9469965754910335 \cdot 10^{-177}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\

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

\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -2.0915467853000205e-42) (not (<= y 1.9469965754910335e-177)))
   (* (- (/ x (- z y)) (/ y (- z y))) t)
   (/ (* t (- x y)) (- 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 tmp;
	if (((y <= -2.0915467853000205e-42) || !(y <= 1.9469965754910335e-177))) {
		tmp = ((double) (((double) ((x / ((double) (z - y))) - (y / ((double) (z - y))))) * t));
	} else {
		tmp = (((double) (t * ((double) (x - y)))) / ((double) (z - y)));
	}
	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.3
Target2.3
Herbie2.4
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -2.0915467853000205e-42 or 1.9469965754910335e-177 < y

    1. Initial program 0.8

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied div-sub_binary640.8

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

    if -2.0915467853000205e-42 < y < 1.9469965754910335e-177

    1. Initial program 5.6

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

      \[\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 \leq -2.0915467853000205 \cdot 10^{-42} \lor \neg \left(y \leq 1.9469965754910335 \cdot 10^{-177}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \end{array}\]

Reproduce

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