Average Error: 2.0 → 1.6
Time: 4.1s
Precision: 64
\[\frac{x}{y} \cdot \left(z - t\right) + t\]
\[\begin{array}{l} \mathbf{if}\;y \le -3.52837154502304928:\\ \;\;\;\;\frac{x}{\frac{y}{z - t}} + t\\ \mathbf{elif}\;y \le 3.806030543013192 \cdot 10^{-182}:\\ \;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \end{array}\]
\frac{x}{y} \cdot \left(z - t\right) + t
\begin{array}{l}
\mathbf{if}\;y \le -3.52837154502304928:\\
\;\;\;\;\frac{x}{\frac{y}{z - t}} + t\\

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

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((y <= -3.5283715450230493)) {
		VAR = ((double) (((double) (x / ((double) (y / ((double) (z - t)))))) + t));
	} else {
		double VAR_1;
		if ((y <= 3.806030543013192e-182)) {
			VAR_1 = ((double) (((double) (((double) (x * ((double) (z - t)))) / y)) + t));
		} else {
			VAR_1 = ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
		}
		VAR = VAR_1;
	}
	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.0
Target2.2
Herbie1.6
\[\begin{array}{l} \mathbf{if}\;z \lt 2.7594565545626922 \cdot 10^{-282}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \mathbf{elif}\;z \lt 2.326994450874436 \cdot 10^{-110}:\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if y < -3.5283715450230493

    1. Initial program 1.2

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
    2. Using strategy rm
    3. Applied associate-*l/9.3

      \[\leadsto \color{blue}{\frac{x \cdot \left(z - t\right)}{y}} + t\]
    4. Using strategy rm
    5. Applied associate-/l*1.2

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{z - t}}} + t\]

    if -3.5283715450230493 < y < 3.806030543013192e-182

    1. Initial program 4.0

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
    2. Using strategy rm
    3. Applied associate-*l/2.4

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

    if 3.806030543013192e-182 < y

    1. Initial program 1.4

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -3.52837154502304928:\\ \;\;\;\;\frac{x}{\frac{y}{z - t}} + t\\ \mathbf{elif}\;y \le 3.806030543013192 \cdot 10^{-182}:\\ \;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\ \end{array}\]

Reproduce

herbie shell --seed 2020129 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))

  (+ (* (/ x y) (- z t)) t))