Average Error: 14.5 → 2.2
Time: 4.3s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.42110258613913981 \cdot 10^{-87} \lor \neg \left(\frac{y}{z} \le 1.1014995100088346 \cdot 10^{-297} \lor \neg \left(\frac{y}{z} \le 1.84201517993839439 \cdot 10^{192}\right)\right):\\ \;\;\;\;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 -1.42110258613913981 \cdot 10^{-87} \lor \neg \left(\frac{y}{z} \le 1.1014995100088346 \cdot 10^{-297} \lor \neg \left(\frac{y}{z} \le 1.84201517993839439 \cdot 10^{192}\right)\right):\\
\;\;\;\;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 (x * (((y / z) * t) / t));
}
double code(double x, double y, double z, double t) {
	double temp;
	if ((((y / z) <= -1.4211025861391398e-87) || !(((y / z) <= 1.1014995100088346e-297) || !((y / z) <= 1.8420151799383944e+192)))) {
		temp = (x * (y / z));
	} else {
		temp = ((x * y) / z);
	}
	return temp;
}

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 2 regimes
  2. if (/ y z) < -1.4211025861391398e-87 or 1.1014995100088346e-297 < (/ y z) < 1.8420151799383944e+192

    1. Initial program 11.1

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

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

    if -1.4211025861391398e-87 < (/ y z) < 1.1014995100088346e-297 or 1.8420151799383944e+192 < (/ y z)

    1. Initial program 20.6

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \frac{y}{z}\right)}\]
    6. Using strategy rm
    7. Applied associate-*r/6.8

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.42110258613913981 \cdot 10^{-87} \lor \neg \left(\frac{y}{z} \le 1.1014995100088346 \cdot 10^{-297} \lor \neg \left(\frac{y}{z} \le 1.84201517993839439 \cdot 10^{192}\right)\right):\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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