Average Error: 16.5 → 9.8
Time: 56.3s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.10600659343343349 \cdot 10^{-35}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right), \frac{y}{a - t}, \mathsf{fma}\left(\mathsf{fma}\left(-z, 1, z\right), \frac{y}{a - t}, x + y\right)\right)\\ \mathbf{elif}\;a \le 3.2108630696058646 \cdot 10^{-139}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\frac{t}{\frac{a - t}{y}} - \frac{z}{\frac{a - t}{y}}\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}\;a \le -1.10600659343343349 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right), \frac{y}{a - t}, \mathsf{fma}\left(\mathsf{fma}\left(-z, 1, z\right), \frac{y}{a - t}, x + y\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\frac{t}{\frac{a - t}{y}} - \frac{z}{\frac{a - t}{y}}\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 temp;
	if ((a <= -1.1060065934334335e-35)) {
		temp = fma(fma((cbrt(t) * cbrt(t)), cbrt(t), -(z * 1.0)), (y / (a - t)), fma(fma(-z, 1.0, z), (y / (a - t)), (x + y)));
	} else {
		double temp_1;
		if ((a <= 3.2108630696058646e-139)) {
			temp_1 = (((z * y) / t) + x);
		} else {
			temp_1 = ((1.0 * ((t / ((a - t) / y)) - (z / ((a - t) / y)))) + (x + y));
		}
		temp = temp_1;
	}
	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.5
Target8.7
Herbie9.8
\[\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 a < -1.1060065934334335e-35

    1. Initial program 14.8

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

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

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

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

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

      \[\leadsto \frac{y}{a - t} \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) + \mathsf{fma}\left(-z, 1, z \cdot 1\right)\right)} + \left(x + y\right)\]
    9. Applied distribute-rgt-in7.4

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t} + \mathsf{fma}\left(-z, 1, z \cdot 1\right) \cdot \frac{y}{a - t}\right)} + \left(x + y\right)\]
    10. Applied associate-+l+7.4

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t} + \left(\mathsf{fma}\left(-z, 1, z \cdot 1\right) \cdot \frac{y}{a - t} + \left(x + y\right)\right)}\]
    11. Simplified7.4

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

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

    if -1.1060065934334335e-35 < a < 3.2108630696058646e-139

    1. Initial program 19.8

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

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

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

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

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

      \[\leadsto \frac{y}{a - t} \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) + \mathsf{fma}\left(-z, 1, z \cdot 1\right)\right)} + \left(x + y\right)\]
    9. Applied distribute-rgt-in18.4

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t} + \mathsf{fma}\left(-z, 1, z \cdot 1\right) \cdot \frac{y}{a - t}\right)} + \left(x + y\right)\]
    10. Applied associate-+l+18.4

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t} + \left(\mathsf{fma}\left(-z, 1, z \cdot 1\right) \cdot \frac{y}{a - t} + \left(x + y\right)\right)}\]
    11. Simplified18.4

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t} + \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-z, 1, z\right), \frac{y}{a - t}, x + y\right)}\]
    12. Using strategy rm
    13. Applied *-un-lft-identity18.4

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

      \[\leadsto \color{blue}{1 \cdot \left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t}\right)} + \mathsf{fma}\left(\mathsf{fma}\left(-z, 1, z\right), \frac{y}{a - t}, x + y\right)\]
    15. Simplified18.4

      \[\leadsto 1 \cdot \color{blue}{\left(\frac{t}{\frac{a - t}{y}} - \frac{z}{\frac{a - t}{y}}\right)} + \mathsf{fma}\left(\mathsf{fma}\left(-z, 1, z\right), \frac{y}{a - t}, x + y\right)\]
    16. Taylor expanded around inf 12.7

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

    if 3.2108630696058646e-139 < a

    1. Initial program 14.9

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

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

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

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

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

      \[\leadsto \frac{y}{a - t} \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) + \mathsf{fma}\left(-z, 1, z \cdot 1\right)\right)} + \left(x + y\right)\]
    9. Applied distribute-rgt-in9.3

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t} + \mathsf{fma}\left(-z, 1, z \cdot 1\right) \cdot \frac{y}{a - t}\right)} + \left(x + y\right)\]
    10. Applied associate-+l+9.3

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right) \cdot \frac{y}{a - t} + \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-z, 1, z\right), \frac{y}{a - t}, x + y\right)}\]
    12. Using strategy rm
    13. Applied *-un-lft-identity9.3

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.10600659343343349 \cdot 10^{-35}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\sqrt[3]{t} \cdot \sqrt[3]{t}, \sqrt[3]{t}, -z \cdot 1\right), \frac{y}{a - t}, \mathsf{fma}\left(\mathsf{fma}\left(-z, 1, z\right), \frac{y}{a - t}, x + y\right)\right)\\ \mathbf{elif}\;a \le 3.2108630696058646 \cdot 10^{-139}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\frac{t}{\frac{a - t}{y}} - \frac{z}{\frac{a - t}{y}}\right) + \left(x + y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020066 +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))))