Average Error: 16.1 → 8.7
Time: 7.0s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -6.3494561716062882 \cdot 10^{-201} \lor \neg \left(a \le 3.2669667908802025 \cdot 10^{-186}\right):\\ \;\;\;\;\left(x + y\right) - \left(\frac{z - t}{\sqrt[3]{a - t}} \cdot \frac{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{1}}}{{\left(\sqrt[3]{\sqrt[3]{a - t}}\right)}^{3}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{a - t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -6.3494561716062882 \cdot 10^{-201} \lor \neg \left(a \le 3.2669667908802025 \cdot 10^{-186}\right):\\
\;\;\;\;\left(x + y\right) - \left(\frac{z - t}{\sqrt[3]{a - t}} \cdot \frac{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{1}}}{{\left(\sqrt[3]{\sqrt[3]{a - t}}\right)}^{3}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{a - t}}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((x + y) - (((z - t) * y) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
	double temp;
	if (((a <= -6.349456171606288e-201) || !(a <= 3.2669667908802025e-186))) {
		temp = ((x + y) - ((((z - t) / cbrt((a - t))) * (((cbrt(y) * cbrt(y)) / cbrt(1.0)) / pow(cbrt(cbrt((a - t))), 3.0))) * (cbrt(y) / cbrt((a - t)))));
	} else {
		temp = (((z * y) / t) + x);
	}
	return temp;
}

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.1
Target8.2
Herbie8.7
\[\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 2 regimes
  2. if a < -6.349456171606288e-201 or 3.2669667908802025e-186 < a

    1. Initial program 15.3

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

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

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt9.6

      \[\leadsto \left(x + y\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{a - t}} \cdot \sqrt[3]{\sqrt[3]{a - t}}\right) \cdot \sqrt[3]{\sqrt[3]{a - t}}\right)}} \cdot \frac{y}{\sqrt[3]{a - t}}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity9.6

      \[\leadsto \left(x + y\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \left(\left(\sqrt[3]{\sqrt[3]{a - t}} \cdot \sqrt[3]{\sqrt[3]{a - t}}\right) \cdot \sqrt[3]{\sqrt[3]{a - t}}\right)} \cdot \frac{y}{\sqrt[3]{\color{blue}{1 \cdot \left(a - t\right)}}}\]
    9. Applied cbrt-prod9.6

      \[\leadsto \left(x + y\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \left(\left(\sqrt[3]{\sqrt[3]{a - t}} \cdot \sqrt[3]{\sqrt[3]{a - t}}\right) \cdot \sqrt[3]{\sqrt[3]{a - t}}\right)} \cdot \frac{y}{\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{a - t}}}\]
    10. Applied add-cube-cbrt9.6

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

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

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

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

    if -6.349456171606288e-201 < a < 3.2669667908802025e-186

    1. Initial program 20.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -6.3494561716062882 \cdot 10^{-201} \lor \neg \left(a \le 3.2669667908802025 \cdot 10^{-186}\right):\\ \;\;\;\;\left(x + y\right) - \left(\frac{z - t}{\sqrt[3]{a - t}} \cdot \frac{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{1}}}{{\left(\sqrt[3]{\sqrt[3]{a - t}}\right)}^{3}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{a - t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \end{array}\]

Reproduce

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

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