Average Error: 16.3 → 11.3
Time: 13.7s
Precision: binary64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -4.62236662418381568 \cdot 10^{27}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;a \le -1.30764370089987406 \cdot 10^{-192}:\\ \;\;\;\;x + \left(y - \frac{\left(z - t\right) \cdot y}{a - t}\right)\\ \mathbf{elif}\;a \le 3.13833703943278678 \cdot 10^{-175}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{elif}\;a \le 2.0626164423737537 \cdot 10^{-64}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;a \le 4.2051587456830085 \cdot 10^{57}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\sqrt{a - t}} \cdot \frac{y}{\sqrt{a - t}}\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -4.62236662418381568 \cdot 10^{27}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\

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

\mathbf{elif}\;a \le 3.13833703943278678 \cdot 10^{-175}:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\

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

\mathbf{elif}\;a \le 4.2051587456830085 \cdot 10^{57}:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (x + y)) - ((double) (((double) (((double) (z - t)) * y)) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((a <= -4.6223666241838157e+27)) {
		VAR = ((double) (((double) (x + y)) - ((double) (((double) (z - t)) / ((double) (((double) (a - t)) / y))))));
	} else {
		double VAR_1;
		if ((a <= -1.307643700899874e-192)) {
			VAR_1 = ((double) (x + ((double) (y - ((double) (((double) (((double) (z - t)) * y)) / ((double) (a - t))))))));
		} else {
			double VAR_2;
			if ((a <= 3.138337039432787e-175)) {
				VAR_2 = ((double) (((double) (((double) (z * y)) / t)) + x));
			} else {
				double VAR_3;
				if ((a <= 2.0626164423737537e-64)) {
					VAR_3 = ((double) (((double) (x + y)) - ((double) (((double) (z - t)) / ((double) (((double) (a - t)) / y))))));
				} else {
					double VAR_4;
					if ((a <= 4.2051587456830085e+57)) {
						VAR_4 = ((double) (((double) (((double) (z * y)) / t)) + x));
					} else {
						VAR_4 = ((double) (((double) (x + y)) - ((double) (((double) (((double) (z - t)) / ((double) sqrt(((double) (a - t)))))) * ((double) (y / ((double) sqrt(((double) (a - t))))))))));
					}
					VAR_3 = VAR_4;
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.3
Target8.0
Herbie11.3
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.3664970889390727 \cdot 10^{-7}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt 1.47542934445772333 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if a < -4.62236662418381568e27 or 3.13833703943278678e-175 < a < 2.0626164423737537e-64

    1. Initial program 14.8

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

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

    if -4.62236662418381568e27 < a < -1.30764370089987406e-192

    1. Initial program 17.0

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

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

    if -1.30764370089987406e-192 < a < 3.13833703943278678e-175 or 2.0626164423737537e-64 < a < 4.2051587456830085e57

    1. Initial program 19.3

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Taylor expanded around inf 14.8

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

    if 4.2051587456830085e57 < a

    1. Initial program 14.1

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt17.0

      \[\leadsto \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{\color{blue}{\sqrt{a - t} \cdot \sqrt{a - t}}}\]
    4. Applied times-frac8.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -4.62236662418381568 \cdot 10^{27}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;a \le -1.30764370089987406 \cdot 10^{-192}:\\ \;\;\;\;x + \left(y - \frac{\left(z - t\right) \cdot y}{a - t}\right)\\ \mathbf{elif}\;a \le 3.13833703943278678 \cdot 10^{-175}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{elif}\;a \le 2.0626164423737537 \cdot 10^{-64}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;a \le 4.2051587456830085 \cdot 10^{57}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\sqrt{a - t}} \cdot \frac{y}{\sqrt{a - t}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020175 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))

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