Average Error: 15.2 → 0.7
Time: 3.4s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -6.93529485640363048 \cdot 10^{283}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.458110975706296 \cdot 10^{-257}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 0.0:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 8.24854180703780398 \cdot 10^{115}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -6.93529485640363048 \cdot 10^{283}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

\mathbf{elif}\;\frac{y}{z} \le 0.0:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;\frac{y}{z} \le 8.24854180703780398 \cdot 10^{115}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (x * ((double) (((double) (((double) (y / z)) * t)) / t))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((double) (y / z)) <= -6.9352948564036305e+283)) {
		VAR = ((double) (((double) (x * y)) / z));
	} else {
		double VAR_1;
		if ((((double) (y / z)) <= -1.458110975706296e-257)) {
			VAR_1 = ((double) (x / ((double) (z / y))));
		} else {
			double VAR_2;
			if ((((double) (y / z)) <= 0.0)) {
				VAR_2 = ((double) (((double) (x * y)) / z));
			} else {
				double VAR_3;
				if ((((double) (y / z)) <= 8.248541807037804e+115)) {
					VAR_3 = ((double) (x * ((double) (y / z))));
				} else {
					VAR_3 = ((double) (((double) (x * y)) / z));
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -6.9352948564036305e+283 or -1.458110975706296e-257 < (/ y z) < 0.0 or 8.248541807037804e+115 < (/ y z)

    1. Initial program 27.3

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified19.6

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/1.4

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

    if -6.9352948564036305e+283 < (/ y z) < -1.458110975706296e-257

    1. Initial program 10.3

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified0.2

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/7.9

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    5. Using strategy rm
    6. Applied associate-/l*0.2

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

    if 0.0 < (/ y z) < 8.248541807037804e+115

    1. Initial program 8.8

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified0.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -6.93529485640363048 \cdot 10^{283}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.458110975706296 \cdot 10^{-257}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 0.0:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 8.24854180703780398 \cdot 10^{115}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020130 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
  :precision binary64
  (* x (/ (* (/ y z) t) t)))