Average Error: 14.4 → 2.6
Time: 1.8s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -2.07328337567161872 \cdot 10^{271}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le -1.6856462603070247 \cdot 10^{-202}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 2.71166063239338584 \cdot 10^{-80}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -2.07328337567161872 \cdot 10^{271}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le -1.6856462603070247 \cdot 10^{-202}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 2.71166063239338584 \cdot 10^{-80}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

\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) (((double) (((double) (y / z)) * t)) / t)) <= -2.0732833756716187e+271)) {
		VAR = ((double) (((double) (x * y)) / z));
	} else {
		double VAR_1;
		if ((((double) (((double) (((double) (y / z)) * t)) / t)) <= -1.6856462603070247e-202)) {
			VAR_1 = ((double) (x * ((double) (y / z))));
		} else {
			double VAR_2;
			if ((((double) (((double) (((double) (y / z)) * t)) / t)) <= 2.711660632393386e-80)) {
				VAR_2 = ((double) (((double) (x * y)) / z));
			} else {
				VAR_2 = ((double) (x / ((double) (z / y))));
			}
			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) t) t) < -2.0732833756716187e+271 or -1.6856462603070247e-202 < (/ (* (/ y z) t) t) < 2.711660632393386e-80

    1. Initial program 23.4

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

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

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

    if -2.0732833756716187e+271 < (/ (* (/ y z) t) t) < -1.6856462603070247e-202

    1. Initial program 0.6

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

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

    if 2.711660632393386e-80 < (/ (* (/ y z) t) t)

    1. Initial program 13.7

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -2.07328337567161872 \cdot 10^{271}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le -1.6856462603070247 \cdot 10^{-202}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 2.71166063239338584 \cdot 10^{-80}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020121 
(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)))