Average Error: 6.5 → 1.3
Time: 3.1min
Precision: binary64
\[\frac{x \cdot y}{z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot y}{z} \le -4.08755864732723577 \cdot 10^{306}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le -9.88131 \cdot 10^{-324}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left|\frac{\sqrt[3]{y}}{\sqrt[3]{z}}\right|\right) \cdot \sqrt{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\ \end{array}\]
\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y}{z} \le -4.08755864732723577 \cdot 10^{306}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

\mathbf{elif}\;\frac{x \cdot y}{z} \le -9.88131 \cdot 10^{-324}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

\end{array}
double code(double x, double y, double z) {
	return (((double) (x * y)) / z);
}
double code(double x, double y, double z) {
	double VAR;
	if (((((double) (x * y)) / z) <= -4.087558647327236e+306)) {
		VAR = (x / (z / y));
	} else {
		double VAR_1;
		if (((((double) (x * y)) / z) <= -9.8813129168249e-324)) {
			VAR_1 = (((double) (x * y)) / z);
		} else {
			VAR_1 = ((double) (((double) (((double) (x * ((double) fabs((((double) cbrt(y)) / ((double) cbrt(z))))))) * ((double) sqrt((((double) (((double) cbrt(y)) * ((double) cbrt(y)))) / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))))))) * (((double) cbrt(y)) / ((double) cbrt(z)))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.5
Target6.3
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;z \lt -4.262230790519429 \cdot 10^{-138}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \lt 1.70421306606504721 \cdot 10^{-164}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x y) z) < -4.08755864732723577e306

    1. Initial program 62.1

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied associate-/l*0.6

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

    if -4.08755864732723577e306 < (/ (* x y) z) < -9.88131e-324

    1. Initial program 0.6

      \[\frac{x \cdot y}{z}\]

    if -9.88131e-324 < (/ (* x y) z)

    1. Initial program 7.8

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity7.8

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    4. Applied times-frac4.9

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
    5. Simplified4.9

      \[\leadsto \color{blue}{x} \cdot \frac{y}{z}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt5.7

      \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    8. Applied add-cube-cbrt5.8

      \[\leadsto x \cdot \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\]
    9. Applied times-frac5.8

      \[\leadsto x \cdot \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\right)}\]
    10. Applied associate-*r*1.7

      \[\leadsto \color{blue}{\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}}\]
    11. Using strategy rm
    12. Applied add-sqr-sqrt1.7

      \[\leadsto \left(x \cdot \color{blue}{\left(\sqrt{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \sqrt{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right)}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\]
    13. Applied associate-*r*1.7

      \[\leadsto \color{blue}{\left(\left(x \cdot \sqrt{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right) \cdot \sqrt{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right)} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\]
    14. Simplified1.7

      \[\leadsto \left(\color{blue}{\left(x \cdot \left|\frac{\sqrt[3]{y}}{\sqrt[3]{z}}\right|\right)} \cdot \sqrt{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot y}{z} \le -4.08755864732723577 \cdot 10^{306}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{x \cdot y}{z} \le -9.88131 \cdot 10^{-324}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left|\frac{\sqrt[3]{y}}{\sqrt[3]{z}}\right|\right) \cdot \sqrt{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020181 
(FPCore (x y z)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))

  (/ (* x y) z))