Average Error: 2.2 → 1.3
Time: 7.0s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -4.51241993351951109 \cdot 10^{-4}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le -0.0:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le 2.56785160016953404 \cdot 10^{278}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -4.51241993351951109 \cdot 10^{-4}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\

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

\mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le 2.56785160016953404 \cdot 10^{278}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

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

\end{array}
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 temp;
	if (((((x - y) / (z - y)) * t) <= -0.0004512419933519511)) {
		temp = (((x - y) * (t / (z - y))) / 1.0);
	} else {
		double temp_1;
		if (((((x - y) / (z - y)) * t) <= -0.0)) {
			temp_1 = (((x - y) * t) / (z - y));
		} else {
			double temp_2;
			if (((((x - y) / (z - y)) * t) <= 2.567851600169534e+278)) {
				temp_2 = (((x - y) / (z - y)) * t);
			} else {
				temp_2 = (((x - y) * (t / (z - y))) / 1.0);
			}
			temp_1 = temp_2;
		}
		temp = temp_1;
	}
	return temp;
}

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.2
Target2.2
Herbie1.3
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 3 regimes
  2. if (* (/ (- x y) (- z y)) t) < -0.0004512419933519511 or 2.567851600169534e+278 < (* (/ (- x y) (- z y)) t)

    1. Initial program 3.9

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity3.9

      \[\leadsto \frac{x - y}{\color{blue}{1 \cdot \left(z - y\right)}} \cdot t\]
    4. Applied add-cube-cbrt5.0

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \sqrt[3]{x - y}}}{1 \cdot \left(z - y\right)} \cdot t\]
    5. Applied times-frac5.0

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1} \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)}\]
    7. Using strategy rm
    8. Applied associate-*l/2.9

      \[\leadsto \color{blue}{\frac{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)}{1}}\]
    9. Simplified2.5

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

    if -0.0004512419933519511 < (* (/ (- x y) (- z y)) t) < -0.0

    1. Initial program 3.3

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

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

    if -0.0 < (* (/ (- x y) (- z y)) t) < 2.567851600169534e+278

    1. Initial program 0.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -4.51241993351951109 \cdot 10^{-4}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le -0.0:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le 2.56785160016953404 \cdot 10^{278}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \end{array}\]

Reproduce

herbie shell --seed 2020058 +o rules:numerics
(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))