Average Error: 2.1 → 3.1
Time: 4.2s
Precision: binary64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -9.45452527082978066 \cdot 10^{132} \lor \neg \left(t \le 5.664138942320091 \cdot 10^{-76}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z - y} \cdot \left(\left(x - y\right) \cdot t\right)\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -9.45452527082978066 \cdot 10^{132} \lor \neg \left(t \le 5.664138942320091 \cdot 10^{-76}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\

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

\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 (((t <= -9.454525270829781e+132) || !(t <= 5.664138942320091e-76))) {
		VAR = ((double) (((double) (((double) (x / ((double) (z - y)))) - ((double) (y / ((double) (z - y)))))) * t));
	} else {
		VAR = ((double) (((double) (1.0 / ((double) (z - y)))) * ((double) (((double) (x - y)) * t))));
	}
	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
Herbie3.1
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if t < -9.45452527082978066e132 or 5.664138942320091e-76 < t

    1. Initial program 2.0

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

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

    if -9.45452527082978066e132 < t < 5.664138942320091e-76

    1. Initial program 2.1

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

      \[\leadsto \color{blue}{\left(\frac{x}{z - y} - \frac{y}{z - y}\right)} \cdot t\]
    4. Using strategy rm
    5. Applied div-inv2.2

      \[\leadsto \left(\frac{x}{z - y} - \color{blue}{y \cdot \frac{1}{z - y}}\right) \cdot t\]
    6. Applied div-inv2.2

      \[\leadsto \left(\color{blue}{x \cdot \frac{1}{z - y}} - y \cdot \frac{1}{z - y}\right) \cdot t\]
    7. Applied distribute-rgt-out--2.2

      \[\leadsto \color{blue}{\left(\frac{1}{z - y} \cdot \left(x - y\right)\right)} \cdot t\]
    8. Applied associate-*l*3.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -9.45452527082978066 \cdot 10^{132} \lor \neg \left(t \le 5.664138942320091 \cdot 10^{-76}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z - y} \cdot \left(\left(x - y\right) \cdot t\right)\\ \end{array}\]

Reproduce

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