Average Error: 2.4 → 3.0
Time: 5.3s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -5901250107637.39355:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \mathbf{elif}\;t \le -5.60125657667623268 \cdot 10^{-260}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{elif}\;t \le 2.92260991475109173 \cdot 10^{-116}:\\ \;\;\;\;\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}\;t \le -5901250107637.39355:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\

\mathbf{elif}\;t \le -5.60125657667623268 \cdot 10^{-260}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\

\mathbf{elif}\;t \le 2.92260991475109173 \cdot 10^{-116}:\\
\;\;\;\;\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 ((t <= -5901250107637.394)) {
		temp = (((x - y) * (t / (z - y))) / 1.0);
	} else {
		double temp_1;
		if ((t <= -5.601256576676233e-260)) {
			temp_1 = (((x - y) * t) / (z - y));
		} else {
			double temp_2;
			if ((t <= 2.922609914751092e-116)) {
				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.4
Target2.3
Herbie3.0
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -5901250107637.394 or 2.922609914751092e-116 < t

    1. Initial program 2.2

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

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

      \[\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-frac3.3

      \[\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*3.1

      \[\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/3.1

      \[\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. Simplified3.7

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

    if -5901250107637.394 < t < -5.601256576676233e-260

    1. Initial program 2.3

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

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

    if -5.601256576676233e-260 < t < 2.922609914751092e-116

    1. Initial program 2.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -5901250107637.39355:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \mathbf{elif}\;t \le -5.60125657667623268 \cdot 10^{-260}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{elif}\;t \le 2.92260991475109173 \cdot 10^{-116}:\\ \;\;\;\;\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 2020057 +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))