Average Error: 2.0 → 1.5
Time: 3.5s
Precision: 64
\[\frac{x}{y} \cdot \left(z - t\right) + t\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.667370803916951 \cdot 10^{-57}:\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \left(\frac{\sqrt[3]{x}}{y} \cdot \left(z - t\right)\right) + t\\ \mathbf{elif}\;y \le 5.60375416897479671 \cdot 10^{-28}:\\ \;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \end{array}\]
\frac{x}{y} \cdot \left(z - t\right) + t
\begin{array}{l}
\mathbf{if}\;y \le -1.667370803916951 \cdot 10^{-57}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \left(\frac{\sqrt[3]{x}}{y} \cdot \left(z - t\right)\right) + t\\

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

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

\end{array}
double code(double x, double y, double z, double t) {
	return (((x / y) * (z - t)) + t);
}
double code(double x, double y, double z, double t) {
	double temp;
	if ((y <= -1.667370803916951e-57)) {
		temp = ((((cbrt(x) * cbrt(x)) / 1.0) * ((cbrt(x) / y) * (z - t))) + t);
	} else {
		double temp_1;
		if ((y <= 5.603754168974797e-28)) {
			temp_1 = (((x * (z - t)) / y) + t);
		} else {
			temp_1 = ((x * ((z - t) / y)) + t);
		}
		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.0
Target2.3
Herbie1.5
\[\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 < -1.667370803916951e-57

    1. Initial program 1.1

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity1.1

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

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

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

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

    if -1.667370803916951e-57 < y < 5.603754168974797e-28

    1. Initial program 3.9

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

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

    if 5.603754168974797e-28 < y

    1. Initial program 1.2

      \[\frac{x}{y} \cdot \left(z - t\right) + t\]
    2. Using strategy rm
    3. Applied div-inv1.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.667370803916951 \cdot 10^{-57}:\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \left(\frac{\sqrt[3]{x}}{y} \cdot \left(z - t\right)\right) + t\\ \mathbf{elif}\;y \le 5.60375416897479671 \cdot 10^{-28}:\\ \;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z - t}{y} + t\\ \end{array}\]

Reproduce

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