Average Error: 15.9 → 9.1
Time: 6.1s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le -2.9384494790728711 \cdot 10^{-282}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \left(\frac{\sqrt[3]{y}}{a - t} \cdot \left(t - z\right)\right) + \left(x + y\right)\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le 1.04412 \cdot 10^{-305}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{a - t}} \cdot \left(t - z\right)\right) + \left(x + y\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{\left(z - t\right) \cdot y}{a - t} \le -2.9384494790728711 \cdot 10^{-282}:\\
\;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \left(\frac{\sqrt[3]{y}}{a - t} \cdot \left(t - z\right)\right) + \left(x + y\right)\\

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

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

\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 VAR;
	if ((((x + y) - (((z - t) * y) / (a - t))) <= -2.938449479072871e-282)) {
		VAR = ((((cbrt(y) * cbrt(y)) / 1.0) * ((cbrt(y) / (a - t)) * (t - z))) + (x + y));
	} else {
		double VAR_1;
		if ((((x + y) - (((z - t) * y) / (a - t))) <= 1.0441159081045042e-305)) {
			VAR_1 = x;
		} else {
			VAR_1 = ((((cbrt(y) * cbrt(y)) / (cbrt((a - t)) * cbrt((a - t)))) * ((cbrt(y) / cbrt((a - t))) * (t - z))) + (x + y));
		}
		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

Original15.9
Target8.7
Herbie9.1
\[\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 3 regimes
  2. if (- (+ x y) (/ (* (- z t) y) (- a t))) < -2.938449479072871e-282

    1. Initial program 12.3

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Simplified8.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, t - z, x + y\right)}\]
    3. Using strategy rm
    4. Applied fma-udef8.1

      \[\leadsto \color{blue}{\frac{y}{a - t} \cdot \left(t - z\right) + \left(x + y\right)}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity8.1

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

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

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

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

    if -2.938449479072871e-282 < (- (+ x y) (/ (* (- z t) y) (- a t))) < 1.0441159081045042e-305

    1. Initial program 60.5

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Simplified60.6

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, t - z, x + y\right)}\]
    3. Taylor expanded around 0 35.5

      \[\leadsto \color{blue}{x}\]

    if 1.0441159081045042e-305 < (- (+ x y) (/ (* (- z t) y) (- a t)))

    1. Initial program 12.4

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Simplified7.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, t - z, x + y\right)}\]
    3. Using strategy rm
    4. Applied fma-udef7.9

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le -2.9384494790728711 \cdot 10^{-282}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \left(\frac{\sqrt[3]{y}}{a - t} \cdot \left(t - z\right)\right) + \left(x + y\right)\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le 1.04412 \cdot 10^{-305}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{a - t}} \cdot \left(t - z\right)\right) + \left(x + y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020105 +o rules:numerics
(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))))