Average Error: 2.1 → 1.6
Time: 8.3s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t \leq -\infty:\\ \;\;\;\;\frac{1}{\frac{z - y}{\left(x - y\right) \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \cdot t \leq -\infty:\\
\;\;\;\;\frac{1}{\frac{z - y}{\left(x - y\right) \cdot t}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

\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)) t) (- INFINITY))
   (/ 1.0 (/ (- z y) (* (- x y) t)))
   (* (/ (- x y) (- z y)) t)))
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 ((((x - y) / (z - y)) * t) <= -((double) INFINITY)) {
		tmp = 1.0 / ((z - y) / ((x - y) * t));
	} else {
		tmp = ((x - y) / (z - y)) * t;
	}
	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.6
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 (-.f64 x y) (-.f64 z y)) t) < -inf.0

    1. Initial program 64.0

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \left(x - y\right)}}{z - y}\]
    5. Using strategy rm
    6. Applied clear-num_binary64_113300.3

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

    if -inf.0 < (*.f64 (/.f64 (-.f64 x y) (-.f64 z y)) t)

    1. Initial program 1.6

      \[\frac{x - y}{z - y} \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t \leq -\infty:\\ \;\;\;\;\frac{1}{\frac{z - y}{\left(x - y\right) \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]

Reproduce

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