Average Error: 17.1 → 8.1
Time: 6.2s
Precision: binary64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq -4.434491333044746 \cdot 10^{-219}:\\ \;\;\;\;x + \left(y + y \cdot \left(\frac{z}{t - a} - \frac{t}{t - a}\right)\right)\\ \mathbf{elif}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq 5.324556684443852 \cdot 10^{-130}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y + \frac{y}{\sqrt[3]{t - a} \cdot \sqrt[3]{t - a}} \cdot \frac{z - t}{\sqrt[3]{t - a}}\right)\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq -4.434491333044746 \cdot 10^{-219}:\\
\;\;\;\;x + \left(y + y \cdot \left(\frac{z}{t - a} - \frac{t}{t - a}\right)\right)\\

\mathbf{elif}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq 5.324556684443852 \cdot 10^{-130}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

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

\end{array}
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (if (<= (+ (+ x y) (/ (* y (- t z)) (- a t))) -4.434491333044746e-219)
   (+ x (+ y (* y (- (/ z (- t a)) (/ t (- t a))))))
   (if (<= (+ (+ x y) (/ (* y (- t z)) (- a t))) 5.324556684443852e-130)
     (+ x (* y (/ z t)))
     (+
      x
      (+
       y
       (*
        (/ y (* (cbrt (- t a)) (cbrt (- t a))))
        (/ (- z t) (cbrt (- t a)))))))))
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (x + y)) - (((double) (((double) (z - t)) * y)) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((((double) (((double) (x + y)) + (((double) (y * ((double) (t - z)))) / ((double) (a - t))))) <= -4.434491333044746e-219)) {
		tmp = ((double) (x + ((double) (y + ((double) (y * ((double) ((z / ((double) (t - a))) - (t / ((double) (t - a)))))))))));
	} else {
		double tmp_1;
		if ((((double) (((double) (x + y)) + (((double) (y * ((double) (t - z)))) / ((double) (a - t))))) <= 5.324556684443852e-130)) {
			tmp_1 = ((double) (x + ((double) (y * (z / t)))));
		} else {
			tmp_1 = ((double) (x + ((double) (y + ((double) ((y / ((double) (((double) cbrt(((double) (t - a)))) * ((double) cbrt(((double) (t - a))))))) * (((double) (z - t)) / ((double) cbrt(((double) (t - a)))))))))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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

Original17.1
Target9.0
Herbie8.1
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} < -1.3664970889390727 \cdot 10^{-07}:\\ \;\;\;\;\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} < 1.4754293444577233 \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 3 regimes
  2. if (- (+ x y) (/ (* (- z t) y) (- a t))) < -4.43449133304474629e-219

    1. Initial program Error: 13.7 bits

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. SimplifiedError: 5.2 bits

      \[\leadsto \color{blue}{x + \left(y + y \cdot \frac{z - t}{t - a}\right)}\]
    3. Using strategy rm
    4. Applied div-subError: 5.2 bits

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

    if -4.43449133304474629e-219 < (- (+ x y) (/ (* (- z t) y) (- a t))) < 5.32455668444e-130

    1. Initial program Error: 43.8 bits

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. SimplifiedError: 24.0 bits

      \[\leadsto \color{blue}{x + \left(y + y \cdot \frac{z - t}{t - a}\right)}\]
    3. Taylor expanded around inf Error: 20.9 bits

      \[\leadsto x + \color{blue}{\frac{z \cdot y}{t}}\]
    4. SimplifiedError: 21.2 bits

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

    if 5.32455668444e-130 < (- (+ x y) (/ (* (- z t) y) (- a t)))

    1. Initial program Error: 13.7 bits

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. SimplifiedError: 5.6 bits

      \[\leadsto \color{blue}{x + \left(y + y \cdot \frac{z - t}{t - a}\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrtError: 7.9 bits

      \[\leadsto x + \left(y + y \cdot \frac{z - t}{\color{blue}{\left(\sqrt[3]{t - a} \cdot \sqrt[3]{t - a}\right) \cdot \sqrt[3]{t - a}}}\right)\]
    5. Applied *-un-lft-identityError: 7.9 bits

      \[\leadsto x + \left(y + y \cdot \frac{\color{blue}{1 \cdot \left(z - t\right)}}{\left(\sqrt[3]{t - a} \cdot \sqrt[3]{t - a}\right) \cdot \sqrt[3]{t - a}}\right)\]
    6. Applied times-fracError: 7.8 bits

      \[\leadsto x + \left(y + y \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{t - a} \cdot \sqrt[3]{t - a}} \cdot \frac{z - t}{\sqrt[3]{t - a}}\right)}\right)\]
    7. Applied associate-*r*Error: 7.7 bits

      \[\leadsto x + \left(y + \color{blue}{\left(y \cdot \frac{1}{\sqrt[3]{t - a} \cdot \sqrt[3]{t - a}}\right) \cdot \frac{z - t}{\sqrt[3]{t - a}}}\right)\]
    8. SimplifiedError: 7.6 bits

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq -4.434491333044746 \cdot 10^{-219}:\\ \;\;\;\;x + \left(y + y \cdot \left(\frac{z}{t - a} - \frac{t}{t - a}\right)\right)\\ \mathbf{elif}\;\left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t} \leq 5.324556684443852 \cdot 10^{-130}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y + \frac{y}{\sqrt[3]{t - a} \cdot \sqrt[3]{t - a}} \cdot \frac{z - t}{\sqrt[3]{t - a}}\right)\\ \end{array}\]

Reproduce

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