Average Error: 2.0 → 2.1
Time: 5.2s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1321875610025753 \cdot 10^{-11} \lor \neg \left(y \leq 1.16814932569234 \cdot 10^{-71}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \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 \leq -1.1321875610025753 \cdot 10^{-11} \lor \neg \left(y \leq 1.16814932569234 \cdot 10^{-71}\right):\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{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 -1.1321875610025753e-11) (not (<= y 1.16814932569234e-71)))
   (* (/ (- x y) (- z y)) t)
   (/ (* (- x y) t) (- z y))))
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.1321875610025753e-11) || !(y <= 1.16814932569234e-71)) {
		tmp = ((x - y) / (z - y)) * t;
	} else {
		tmp = ((x - y) * t) / (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.0
Target2.0
Herbie2.1
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -1.13218756100257535e-11 or 1.16814932569234008e-71 < y

    1. Initial program 0.3

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

    if -1.13218756100257535e-11 < y < 1.16814932569234008e-71

    1. Initial program 4.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1321875610025753 \cdot 10^{-11} \lor \neg \left(y \leq 1.16814932569234 \cdot 10^{-71}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \end{array}\]

Reproduce

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